Re: From 24/7/2013 to 2013-07-24

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

 



On Jul 26, 2013, at 4:18 AM, Karl-Arne Gjersøyen <karlarneg@xxxxxxxxx> 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);
>       rsort($dag);

You want to reverse the array, not sort it :) array_reverse().

>        $dag = implode("-", $dag);
>        var_dump($dag);
> 
> What I want is a way to rewrite contents of a variable like this:
> 
> From 24/7/2013 to 2013-07-24
> 
> Is there a way in PHP to do this?
> 
> Thank you very much.
> 
> Karl

Also, I thought the locale for European countries used periods as separators, not slashes; slashes for North America…

*shrug*


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