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

It asks me to use "F", and that is exactly what I'm already doing, AND output is correct, but I get a bummer!

I just have to say: Today is (month) (day of the month with leading 0) (comma) (year) and I have the output correctly. Is there something in my program I don't see?

Thanks!

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

2 Answers

andren
andren
28,558 Points

The code checker is often pretty picky about how your code is formatted, it doesn't tend to like when a space is placed between a function name and the parenthesis following it. Since only the third of your date calls have the parenthesis right after the name that is the only one it registers, which is why it complains about you not passing in "F".

Also the date function accepts multiple placeholders being passed to it at once, so you don't need to call it multiple times. If you remove the space before the parenthesis and move all of the placeholders and spaces into just one date call like this:

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

Then your code will pass.

Thank you very much! Andre, it worked! and with that, I finished the course. Thanks for the help! :D