Is this code wrong?!?!?


#1



<html>
	<head>
		<title></title>
	</head>
	<body>
      <p>
        <?php
        function aboutMe($name, $age) {
            echo "Hello! My name is $name, and I am $age years old."
        }
        $name = "Jorge";
        $age = 19;
        aboutMe($name, $age);
        ?>
      </p>
    </body>
</html>


#2

Please provide a link to the lesson and the error message you are getting. Thank you.

What we can see in the above is one syntax error:

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

Missing semi-colon is the problem.


#3

@objectmaster13016,
or use

echo "Hello!<br /> My name is ".$name.", and I am ".$age." years old.";

#4

When using double quotes we can interpolate variables in a string without the need to concatenate. The OP has the right code, save the missing semi-colon.