if you are sure $date will *always* be of the same format:
function date_manipulator($date=0)
{
Global $year,$day,$month; // I should update your variables from a
previous call, if you don't need it - don't use it ...
if($date!=0) {
$year = substring($date,0,4);
$month = substring($date,4,6); // you mean that the month follows the
year? (not clear in your example)
$day = substring($date,6,8);
return "Today's date is $day $month $year"; or use mktime() etc ...
}
}
Cheers,
Maxim Maletsky
-----Original Message-----
From: Fredrik Arild Takle [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 29, 2001 4:32 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Problem!
1.
$date = "20010101";
How could I output 01 01 2001 (or make it 3 variables, like day, month,
year)?
2.
What is the best way to encrypt (using PHP and MySQL)?
Could you please answer me directly by mailadr. ([EMAIL PROTECTED]), because
I'm currently not a member of this list at home!
---------------------------------
Fredrik A. Takle
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]