[PHP] convert date to reversed date

2007-01-30 Thread Reinhart Viane
Is this a good way to convert 01/02/2007 to 20070201 $value='01/02/2007'; list($day, $month, $year) = split('[/.-]', $value); $filename=$year.''.$month.''.$day; It does work but i would like to verify if there are no better, more logical ways to do this. Thanks in advance

Re: [PHP] convert date to reversed date

2007-01-30 Thread Fredrik Thunberg
Reinhart Viane skrev: Is this a good way to convert 01/02/2007 to 20070201 $value='01/02/2007'; list($day, $month, $year) = split('[/.-]', $value); $filename=$year.''.$month.''.$day; It does work but i would like to verify if there are no better, more logical ways to do this. Thanks

Re: [PHP] convert date to reversed date

2007-01-30 Thread Fredrik Thunberg
date("Ymd", strotodate( $value )); Of course I mean: date( "Ydm", strtodate( $value )); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

RE: [PHP] convert date to reversed date

2007-01-30 Thread Reinhart Viane
I suppose you mean strtotime -Oorspronkelijk bericht- Van: Fredrik Thunberg [mailto:[EMAIL PROTECTED] Verzonden: dinsdag 30 januari 2007 16:36 CC: php-general@lists.php.net Onderwerp: Re: [PHP] convert date to reversed date > date("Ymd", strotodate( $value )); >

Re: [PHP] convert date to reversed date

2007-01-30 Thread Arpad Ray
$filename = implode(array_reverse(explode('/', $value))); Arpad Reinhart Viane wrote: Is this a good way to convert 01/02/2007 to 20070201 $value='01/02/2007'; list($day, $month, $year) = split('[/.-]', $value); $filename=$year.''.$month.''.$day; It does work but i would like to ver

Re: [PHP] convert date to reversed date

2007-01-30 Thread Jim Lucas
Arpad Ray wrote: $filename = implode(array_reverse(explode('/', $value))); I think you ment $filename = implode('', array_reverse(explode('/', $value))); Arpad Reinhart Viane wrote: Is this a good way to convert 01/02/2007 to 20070201 $value='01/02/2007'; list($day, $month, $year) =

Re: [PHP] convert date to reversed date

2007-01-30 Thread Jim Lucas
Jim Lucas wrote: Arpad Ray wrote: $filename = implode(array_reverse(explode('/', $value))); I should have checked before I wrote. It does work, but through me off, didn't realize that the first arg was optional. Sorry I think you ment $filename = implode('', array_reverse(explode('/',