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 trialNdong Landry
1,703 Pointsgetlastmod() function gave a parse error: syntax error, after using it, please kindly help, thanks
<?php echo date('Y'); echo $displayname; echo "Last modified: " . date ("F d Y H:i:s.", getlastmod()); ?>
Please what could possibly be wrong with this, I didn't get the expected results. this is what i got,
Parse error: syntax error, unexpected '"Last modified: "' (T_CONSTANT_ENCAPSED_STRING) in /home/treehouse/workspace/index.php on line 44
1 Answer
Kat Cuccia
786 Points$displayname should be $displayName. Variables are case-sensitive. You need to remove the period after H:i:s in the getlastmod date format.
Lax Shah
546 PointsLax Shah
546 PointsWhy remove H:i:s?