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

Site bug(Bummer)

This is my code below:

Bummer: Looks like you forgot the echo command

index.php
<?php
$date = date('F d, Y');
echo "Today is $date";
?>

1 Answer

Niki Molnar
Niki Molnar
25,698 Points

Hi Robert

Your PHP is correct - this is just a quirk of the question and how they wanted the answer to be. It asked for a "single date function". What you did was put it into a variable then call the variable.

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

It will then echo out 'Today is July 17, 2018' as there is no line break between the 2 echos, so it will just continue. All you needed, therefore, was to echo the date.

Good luck!

Niki

Thanks!