Jump to content

convert date


dreamwest

Recommended Posts

You would use a simple look-up array -

 

<?php
// note: leading zero's make numbers octal, so to avoid problems with 08 and 09, two-character strings are used
$mth_name = array('01' => 'January', '02' => 'February'); // add the rest of the months
$mth = '02';
echo $mth_name[$mth];
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/187526-convert-date/#findComment-990119
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.