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!
Two methods. One processes the text, and the other uses built in methods to parse and format the date. The second one would be easier to understand quickly when reading code.
Method 1:
(like s992 said, you use strtotime() to parse it)
$date = new DateTime('20101105');
echo $date->format('Y-m-d'); //2010-11-05
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Jonah Bron wrote:That code is not very easy to understand quickly. I suggest you use one of the solutions I gave, probably the second one.
yes
i will use your second one, also because maybe my solution demands more recources. Certainly because i use it in a while loop to generate a table...