Re: Array mysteries

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



At 10:05 AM +0100 3/11/07, Tijnema ! wrote:

- You could define $wdays inside the function
function convert_from_weekday ($weekday,$wdays) {
$wdays = array
   (0 => "Sonntag"
   ,1 => "Montag"
   ,2 => "Dienstag"
   ,3 => "Mittwoch"
   ,4 => "Donnerstag"
   ,5 => "Freitag"
   ,6 => "Samstag"
 );
   return $wdays[$weekday];
 }
$day = convert_from_weekday(0) // $day = "Sonntag"

Tijnema:

That's also a shorter version of a simple switch statement.

I haven't thought of, or seen, that before -- thanks.

tedd
--
-------
http://sperling.com  http://ancientstones.com  http://earthstones.com

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux