This doesn’t work:
$F = "<div class='f'>F</div>";
$d = "<div class='d'>d</div>";
$Y = "<div class='y'>Y</div>";
$dateFormat = "$F, $d, $Y";
echo date($dateFormat);
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
date()will not filter out the HTML tags from the parameter you pass; that is the case of many other PHP functions to which you pass a string containing HTML tags.The only function that removes HTML tags is
strip_tags(). If, for any reason, you are using as parameter of a function a string containing HTML (I don’t know in which case it could happen — maybe you are doing something wrong in other parts of the code), you can use the following code, valid for the example you reported.This is the answer to your question. Probably your problem is another one; in that case, the question should have been another one.
I think there are some chances that Sbm007 understood what you meant; the question should have been then