RES: [PHP] From 24/7/2013 to 2013-07-24
| From: | Alejandro Michelin Salomon | Date: | Fri, 26 Jul 2013 15:06:42 +0000 |
| Subject: | RES: [PHP] From 24/7/2013 to 2013-07-24 | ||
| References: | 1 2 3 4 5 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-321720@lists.php.net to get a copy of this message | ||
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.giner@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
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-2407 that you want".
--
PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:
http://www.php.net/unsub.php