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 trialGeronimo Morisot
1,435 PointsThe function i'm replying is correct but it isn't submiting.
Asked to add date in PHP in a SINGLE line and in a designated format, i did as it asked to but it doesn't let me pass the test.
<?php
echo 'Today is ';
//Place your code below this comment
echo "Today is " . date ('F d, Y');
?>
5 Answers
Spenser Hale
20,915 PointsHello Geronimo.
You are very close. In php the left hand parentheses need to be touching the function name, ie with no spaces.
<?php
date('F d, Y');
Additionally, you are duplicating the Today is, so once you fix your function call, it will print Today is Today is September 20, 2018, instead of Today is September 20, 2018. I would remove the "Today is" and just echo the date.
<?php
echo 'Today is ';
//Place your code below this comment
echo date('F d, Y');
KRIS NIKOLAISEN
54,971 PointsRemove the space between date and ('F d, Y') . The following should pass:
<?php
echo 'Today is ';
//Place your code below this comment
echo date('F d, Y');
?>
KRIS NIKOLAISEN
54,971 PointsIn the challenge click preview and check the results
Geronimo Morisot
1,435 PointsHi Kris. Already did, in the code that got here i know i repeated the echo for 'Today is ' but if i take it away is still the same. It keeps saying "Bummer: You must use the built-in date function".
Geronimo Morisot
1,435 PointsThanks Kris and Spencer, that did the job.