This forum is now read-only. Please use our new forums! Go to forums
This just isn't right
I have found several people with similar issues on this exercise but none of their solutions (like leaving out all the extra “ and . or using print instead of echo work for me. Here is what I have:
function aboutme($name, $age) {
echo "Hello! My names is " . $name . " and I am " . $age . " years old.";
}
aboutme("Nat", "21");
?>
Hello! My names is Nat and I am 21 years old.
Oops, try again! It looks like your code printed ‘Hello! My names is Nat and I am 21 years old.’ instead of ‘Hello! My name is [your name here] and I am [your age here] years old.’
This has got to be a bug, but the better question is why no one fixes it.
Answer 5229f47ef10c601bfc003f05
It should be My name is
, you wrote My names is
.
Answer 52433fecf10c608868000a6c
I’m getting the same error, here’s my code <?php function aboutMe($name, $age) { echo “Hello! My name is “ . $name . “ and I am “ . $age . “ years old.”; } aboutMe(“Anne Marie”, 22);
?>
and the error message is
Oops, try again! It looks like your code printed ‘Hello! My name is Anne Marie and I am 22 years old.’ instead of ‘Hello! My name is [your name here] and I am [your age here] years old.’
2 comments
The SCT has trouble with multi-word names. Using “Anne” or “Marie’ individually should do the trick.
ADEN: This was the best explanation of the problem using two words. thanks!
Answer 5245829a548c35164d000c64
I am getting the very same error. I have checked probably ten times now to make sure the strings match perfectly.
'Hello! My name is ' . $name . ' and I am ' . $age . ' years old.';
I still get the exact same error :/
1 comments
Your function is okay, but you might be passing in two words as your name in the function call, which messes up the SCT.
Answer 52539871548c353f11003d9b
Its work
<?php
function aboutMe($name,$age){
echo "Hello! My name is ". $name . ", and I am ". $age . "years old.";
}
aboutMe("Ahmad Muhajir", 21)
?>
Popular free courses
- Free Course
Learn SQL
In this SQL course, you'll learn how to manage large datasets and analyze real data using the standard data management language.Beginner friendly,4 LessonsLanguage Fluency - Free Course
Learn JavaScript
Learn how to use JavaScript — a powerful and flexible programming language for adding website interactivity.Beginner friendly,11 LessonsLanguage Fluency - Free Course
Learn HTML
Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.Beginner friendly,6 LessonsLanguage Fluency
2 comments
Well, that was it. So thank you, but I still think the error message could have been a little more enlightening and specific.
Agreed, the academy error messages are very hit and miss!