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

Use the date function to add todays date to the display message in the following format: full month, day of the month...

This is exactly the same problem someone else had but I don't see that it got answered.

The date today is November 11, 2016. My code is:

<?php
echo 'Today is ';
//place your code below this line
$today = date('F d, Y'); //I  could have left this out and just echoed the right side
echo $today;
?>

The review displays: Today is November 11, 2016

But the challenge says 'Bummer! Looks like you forgot the echo'

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

1 Answer

Greg Thomas
Greg Thomas
12,884 Points

Hey Doug, It might just be something going on with how they want the answer formatted. If you use

<?php
echo 'Today is ';
//Place your code below this comment
echo date('F d, Y');
?>

that should work properly. -Greg

Yeah, you are right. The challenge did not like my interim variable ($today = date('F d, Y'). How frustrating is that?