This forum is now read-only. Please use our new forums! Go to forums
Error in validation in the exercise 7 of Defining Functions in PHP
The validation in the exercise 7 of Defining Functions in PHP, does not work properly.
function aboutMe($name, $age) {
print "Hello! My name is $name, and I am $age years old.";
}
aboutMe("John Doe", 25);
I tried with the comma value after $name, but nothing.
Answer 517c7a40fbe7c6c52e0018b3
3 votes
THE ANSWER: Don’t pass the comma value after the parameter $name and don’t pass more than one name (with a single name, it works): Example (corrected):
function aboutMe($name, $age) {
print "Hello! My name is $name and I am $age years old";
}
aboutMe("John", 25);
Answer 51f7280c7c82caed11000fdb
0 votes
Hi guys,
Here is answer: htmlentities function, search about it.
Answer 5230c04e80ff334ae800673b
0 votes
The window doesn’t include the PHP tags in it, but the emulator renders the PHP code anyway. That’s what screwed me up. Once I added the PHP tags, it worked.
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
1 comments
Alright, this helped. Though I burned 10 minutes thinking there was something small I missed that’s wronging my code. Will check Q&A sooner next time.