It sounds easy. I've done it before, but when I browse the web for a solution, I turn up nothing.
I have a string like this: 04/07/2012
I want to turn this into a month, day, and year variable. How do I do that?
Thanks,
M
Printable View
It sounds easy. I've done it before, but when I browse the web for a solution, I turn up nothing.
I have a string like this: 04/07/2012
I want to turn this into a month, day, and year variable. How do I do that?
Thanks,
M
Argh! Answered my own question.
That took some searching.PHP Code:<?php
// Delimiters may be slash, dot, or hyphen
$date = "04/30/1973";
list($month, $day, $year) = split('[/.-]', $date);
echo "Month: $month; Day: $day; Year: $year<br />\n";
?>