This forum is now read-only. Please use our new forums! Go to forums
Practicing with ForEach Issue
<?php
$sentence = array("I'm ", "learning ", "PHP!");
foreach ($sentence as $word) {
echo $word;
}
?>
When I try to submit this code, It gives me this error:
Oops, try again! It looks like nothing was echoed!
What should I do?
Answer 515f34455545f0ab05002022
1 vote
Never mind. Apparently it worked now.
Answer 51a3012a02318198f1001dc0
1 vote
You see!!! it is “ foreach” <?php $sentence = array(“I’m “, “learning “, “PHP!”);
foreach($sentence as $word){
echo $word;
}
?>
1 comments
Raahul Jaykar over 10 years
Answer 5161d0204c59c6ddda000acc
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
sometimes that happends on codecademy