Re: convert numerical day of week

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

 



On Tue, 2007-05-22 at 17:54 -0500, Greg Donald wrote:
> On 5/22/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
> > Yours is the least maintainable.
> 
> Hehe..  with 4 times as many lines of code and 160% more bytes of code overall?
> 
> > cat locale.php|grep -v ^$|wc -l
>       16
> 
> > cat simple.php|grep -v ^$|wc -l
>        4
> 
> 
> > ls -lavh
> -rw-r--r--    1 destiney  destiney  347B May 22 17:35 locale.php
> -rw-r--r--    1 destiney  destiney  133B May 22 17:35 simple.php
> 
> 
> Watch me switch this from English to Spanish:
> 
> #$days = array( 'Sunday', 'Monday', 'Tuesday', 'Wednesday',
> 'Thursday', 'Friday', 'Saturday' );
> $days = array( 'Domingo', 'Lunes', 'Martes', 'Miércoles', 'Jueves',
> 'Viernes', 'Sábado' );
> 
> Tada!  That was the easiest maintenance programming ever.

Sure, but you need to do that whenever the locale changes. I don't need
to change anything for the weekday names to be portable across all
locales. And yes I know, as you pointed out, the OP didn't say anything
about locale *shrug*. IMHO your solution is still inferior... but I
guess you like it that way.

> > I have nothing to learn from you that I
> > didn't learn in kindergarten.
> 
> They didn't teach PHP where I attended kindergarten.  Is that a Canadian thing?

Exactly, and I'm not about to learn PHP from you now *lol*.

Cheers,
Rob.
-- 
.------------------------------------------------------------.
| InterJinn Application Framework - http://www.interjinn.com |
:------------------------------------------------------------:
| An application and templating framework for PHP. Boasting  |
| a powerful, scalable system for accessing system services  |
| such as forms, properties, sessions, and caches. InterJinn |
| also provides an extremely flexible architecture for       |
| creating re-usable components quickly and easily.          |
`------------------------------------------------------------'

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