Array mysteries

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

 



I want to convert weekdays with a simple function like

  $wdays = array
    (0 => "Sonntag"
    ,1 => "Montag"
    ,2 => "Dienstag"
    ,3 => "Mittwoch"
    ,4 => "Donnerstag"
    ,5 => "Freitag"
    ,6 => "Samstag"
  );

  function convert_from_weekday ($weekday) {
    return $wdays[$weekday];
  }

but this doesn't work while

  $wdays[$weekday];

outside of the function works correct. Has anybody an idea where's my mistake? I'd like to use a function so I may return substrings of the weekday.

O. Wyss

--
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