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

nicholasgryczewski
nicholasgryczewski
2,919 Points

It says I need to use the built in function. I was able to get it to display what it wants but it's not right apparently

For this code challenge, you'll need to check out the documentation for the date function to see details about formatting.

Use the date function to add todays date to the display message in the following format: full month, day of the month with leading 0, comma and 4 digit year.

Example: Today is July 04, 2016

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

2 Answers

This particular challenge isn't allowing a space after date It would be ok in a real project.

Also, you need to echo the date.

In addition to what Jason Anello has said, you must concatenate the two strings together using a dot (.). Then you can echo out the combined string.

Hi Brock,

Normally that's probably what you would do on a real project. However, this challenge is expecting 2 separate echo statements or it won't pass.