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

Tahsin Ahmed
Tahsin Ahmed
7,828 Points

I'm doing it right and producing the right output but workspaces thinks I'm not...

Is there a certain way I'm supposed to fix this? I typed: date('F d\, Y');

It formats correctly in the Preview...

echo 'Today is ';
//Place your code below this comment
echo date('F d\, Y');


2 Answers

Greg Kaleka
Greg Kaleka
39,021 Points

Hi Tahsin,

You've just about got it, but you don't need that escape character. Remove the \ and you'll be all set.

Cheers :beers:


Tahsin Ahmed
Tahsin Ahmed
7,828 Points

It works! Thank you very much

Robert Bennett
Robert Bennett
11,927 Points

There is a lot of ways to pick the date in the PHP maunal - here is the code that worked for me... It kept throwing a syntax error because the capital F wasn't touching the parentheses!

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