PHP to get date?

I’m trying with the below code, to get todays date to show as Friday, the 30th of September 2016, but further down is how it is appearing? How would you do it please?

<?php 
date_default_timezone_set('GMT');
#echo date("l, \\t\h\e jS of F, Y,"); 
echo date("l, \\t\h\e jS \of F, Y"); 
?>

Friday, th 30th of September, 2016

Have you checked the PHP manual?

http://php.net/manual/en/function.date.php

2 Likes

Thanks John, I did go through that page yesterday, but couldn’t find the solution.

Example #2 Escaping characters in date()

<?php // prints something like: Wednesday the 15th echo date('l \t\h\e jS'); ?>

Thank you very much John, I must have missed that bit. You know, I set this particluar piece of code about 6 years ago, I checked it and it was working fine? But now, for example, there’s differences of quotation marks and apostrophes?

1 Like

Please supply an example of incorrect script and your expectations.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.