Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

PHP PHP Basics PHP on the Web Date Function

Yu-Che Hung
PLUS
Yu-Che Hung
Courses Plus Student 10,607 Points

why it keeps telling me that I forgot the echo command?

why it keeps telling me that I forgot the echo command? I already typed it

index.php
<?php
echo "Today is ";
//Place your code below this comment
$today= date("M d,Y");
echo "Today is $today ";
?>

2 Answers

Brett Marion
Brett Marion
6,915 Points

Hello Yen,

Try the following code.

<?php
echo 'Today is ';
//Place your code below this comment
echo date("F d, Y");
?>
Rune Andreas Nielsen
Rune Andreas Nielsen
5,354 Points

Hi, Yen.

I don't have a subscription to TreeHouse, but from what I can see (without testing)

Your code should look like this:

<?php
echo "Today is ";
//Place your code below this comment
$today= date("F j, Y"); 
echo "$today ";
?>

So the final output matches the required challenge output: "Today is July 04, 2016"

The issue with your implementation of the challenge is that you echo "Today is" two times and the date does not match the format that is requested.

Have fun programming. :)