PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
I've the following code, but I want to insert some spaces or some characters between the date and the time (betwwen the letter Y and letter g below), how do I do that? I tried with the space but it doesn't work.
Either add escaped characters into the format string or create the date component, add your additional text, then the time component. I can only assume you're attempting to see this in a browser, in which case you will need for additional spaces beyond one.
I want to use the escaped character in the string instead of create a date component and a time component. Am I not using the escaped character correctly?
As feyd touched on, your browser will render two or more consecutive spaces as one, and the only way to override that is to replace the additional spaces with the escape sequence:
If you stick that straight into the date() call, you'll have to escape at least a few of those letters lest date() tries to interpret them. date()'s special characters are listed in the manual entry (date()); all are escaped with a backslash.