[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-db
Subject:    RE: [PHP-DB] month
From:       "Bastien Koert" <bastien_k () hotmail ! com>
Date:       2006-10-16 4:59:50
Message-ID: BAY106-F24C16D493E616133B19DE19D090 () phx ! gbl
[Download RAW message or body]

use an array

$months = array('01'=>'January','02'=>'February'...);

$thisMonths = array_flip($months);
$month = $thisMonths['January'];

echo $month;

though its easier to just create the array the other way and the just 
reference it

$months = array(''January''=>'01','February'=>'02...');

$month = $months[January'];



Bastien

>From: "Ron Piggott (PHP)" <ron.php@actsministries.org>
>Reply-To: ron.php@actsministries.org
>To: PHP DB <php-db@lists.php.net>
>Subject: [PHP-DB] month
>Date: Sun, 15 Oct 2006 22:50:48 -0400
>
>Is there a slick and easy way to convert January to 01 ? (and February
>to 02, etc)  Ron

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic