Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Tamara Temple
augh, apologies; i didn't see all the other replies…. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Tamara Temple
On Jul 26, 2013, at 4:18 AM, Karl-Arne Gjersøyen wrote: > Below is something I try that ofcourse not work because of rsosort. > Here is my code: > --- > $lagret_dato = $_POST['lagret_dato']; >foreach($lagret_dato as $dag){ > >$dag = explode("/", $dag); > rs

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Robert Cummings
On 13-07-26 05:33 PM, Jim Giner wrote: On 7/26/2013 5:29 PM, Robert Cummings wrote: And so it follows, that my solution, thus far, is the only solution posted that actually meets the requirements. Why you think my solution does not perform is beyond me since a simple run of the code would output

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Jim Giner
On 7/26/2013 5:29 PM, Robert Cummings wrote: On 13-07-26 04:38 PM, jomali wrote: On Fri, Jul 26, 2013 at 1:08 PM, Robert Cummings wrote: On 13-07-26 11:42 AM, jomali wrote: On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen wrote: Below is something I try that ofcourse not work becaus

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Robert Cummings
On 13-07-26 04:38 PM, jomali wrote: On Fri, Jul 26, 2013 at 1:08 PM, Robert Cummings wrote: On 13-07-26 11:42 AM, jomali wrote: On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen wrote: Below is something I try that ofcourse not work because of rsosort. Here is my code: --

RES: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Alejandro Michelin Salomon
jomali: Use this: echo preg_replace('#(\d{2})/(\d{2})/(\d{4})#' , "\\3-\\2-\\1", '24/07/2013' ); RESULT => 2013-07-24 Alejandro M.S -Mensagem original- De: jomali [mailto:jomali3...@gmail.com] Enviada em: sexta-feira, 26 de julho de 2013 17:38 Para: Robert Cummings Cc: Karl-Arne Gjersøy

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread jomali
On Fri, Jul 26, 2013 at 1:08 PM, Robert Cummings wrote: > On 13-07-26 11:42 AM, jomali wrote: > >> On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen > >wrote: >> >> Below is something I try that ofcourse not work because of rsosort. >>> Here is my code: >>> --- >>> $lagret_

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Robert Cummings
On 13-07-26 11:42 AM, jomali wrote: On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen wrote: Below is something I try that ofcourse not work because of rsosort. Here is my code: --- $lagret_dato = $_POST['lagret_dato']; foreach($lagret_dato as $dag){ $dag =

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread jomali
On Fri, Jul 26, 2013 at 5:18 AM, Karl-Arne Gjersøyen wrote: > Below is something I try that ofcourse not work because of rsosort. > Here is my code: > --- > $lagret_dato = $_POST['lagret_dato']; > foreach($lagret_dato as $dag){ > > $dag = explode("/", $dag); >

RES: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Alejandro Michelin Salomon
Use this: echo preg_replace('#(\d{2})/(\d{2})/(\d{4})#' , "\\3-\\2-\\1", '24/07/2013' ); RESULT => 2013-07-24 Alejandro M.S -Mensagem original- De: Jim Giner [mailto:jim.gi...@albanyhandball.com] Enviada em: sexta-feira, 26 de julho de 2013 11:12 Para: php-general@lists.php.net Assunto

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Jim Giner
On 7/26/2013 10:10 AM, Jim Giner wrote: I think you should change from using 'rsort' ( a SORT function) to 'array_reverse', a simple reverse function. Your example of what you desire is wrong. 24-7-2013 will give you the 2013-24-7 that you want. oops. I meant to say "will NOT give you the 2013-

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Jim Giner
I think you should change from using 'rsort' ( a SORT function) to 'array_reverse', a simple reverse function. Your example of what you desire is wrong. 24-7-2013 will give you the 2013-24-7 that you want. Here is my sample code. Try it yourself. **"; echo "Try using rsort"; $dagparts =

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Karl-Arne Gjersøyen
2013/7/26 Davi Marcondes Moreira > Hi! I suggest you to try this: > > $foo = DateTime::createFromFormat('d/m/Y'); > $newDate = $foo->format('Y-m-d'); > Thank you veyr much. With a small modification this work perfec! Karl > Em 26/07/2013 09:19, "Karl-Arne Gjersøyen" > escreveu: > > Below i

Re: [PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Přemysl Fiala
Hello, try & - reference foreach($lagret_dato as &$dag) or something like this :-) Premek. On Fri, 26 Jul 2013 11:18:03 +0200, Karl-Arne Gjersøyen wrote: Below is something I try that ofcourse not work because of rsosort. Here is my code: --- $lagret_dato = $_POST['l

[PHP] From 24/7/2013 to 2013-07-24

2013-07-26 Thread Karl-Arne Gjersøyen
Below is something I try that ofcourse not work because of rsosort. Here is my code: --- $lagret_dato = $_POST['lagret_dato']; foreach($lagret_dato as $dag){ $dag = explode("/", $dag); rsort($dag); $dag = implode("-", $dag); var_dump($dag); W