PHP functions, part II; what's wrong with my code?


#1

I'm on the last exercise and I'm stuck. It seems the interpreter is not reading my function correctly. Here the link to the exercise:

https://www.codecademy.com/courses/web-beginner-en-RcIEe/0/7?curriculum_id=5124ef4c78d510dd89003eb8

The error message it's returning is this:
Parse error: syntax error, unexpected '<' on line 9 >

When I click on "Save and Submit", there's a message that basically says I haven't properly called my function even though I have. Nothing I've tried has worked so far. Here's my code:

        function aboutMe($name, $age)
        {echo "Hello!  My name is" .$name. " and I am" .$age. "years old."};
        
        aboutMe("Michael", 38);

#2

Hi!

Place a semi-colon at the end of the echo statement so you now have.

        {echo "Hello!  My name is" .$name. " and I am" .$age. "years old.";};

I hope this helps! :wink:


#3

Thanks bayoishola20. That worked.


#4

You're welcome.

Have fun coding! :smile:


#5

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.