Hi,
I have been trying to split up a number string with PHP into individual chars but have had no luck so far. I have used str_split and according to the manual what I'm doing should work, but it isn't.
Bascially what I have is this:
PHP Code:
$dateFormat = str_split($row[DATE], 1);
echo $dateFormat[0]; echo $dateFormat[1]; echo "/"; echo $dateFormat[2]; echo $dateFormat[3]; echo "/"; echo $dateFormat[4]; echo $dateFormat[5]; echo $dateFormat[6]; echo $dateFormat[7];
$row[DATE] is a string for the date which comes out of the database, for example, it could be: 15072012. I need it to be in this format for other processes I have running in the background, but what I need for this process is for 15072012 to be re-formatted to 15/07/2012.
Any pointers or guidance would be appreciated.
Thanks! :-)
Bookmarks