I've faced with converting Date to String by using date() function in php.
Simply, I just want to print this '17th of January 2012' by using format character.
print date("jS of F Y");
However, the output was 17th 2012f January 2012 and.. is there any way to escape 'o' string to get the output I want.
Escape the o with a backslash:
print date("jS \of F Y");
From the documentation:
You can prevent a recognized character in the format string from being expanded by escaping it with a preceding backslash.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With