Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP PHP Basics PHP on the Web Date Function

Yu-Che Hung
PLUS
Yu-Che Hung
Courses Plus Student 10,607 Points

why it keeps telling me that I forgot the echo command?

why it keeps telling me that I forgot the echo command? I already typed it

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

2 Answers

Brett Marion
Brett Marion
6,915 Points

Hello Yen,

Try the following code.

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

Hi, Yen.

I don't have a subscription to TreeHouse, but from what I can see (without testing)

Your code should look like this:

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

So the final output matches the required challenge output: "Today is July 04, 2016"

The issue with your implementation of the challenge is that you echo "Today is" two times and the date does not match the format that is requested.

Have fun programming. :)