Created
July 31, 2019 17:14
-
-
Save parzibyte/8ea3c1a0a9cc2b89d9c4666ba4a42dbc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$arreglo = [ | |
"2019-07-30 07:00:00", | |
"2002-11-24 13:15:20", | |
"2007-10-29 15:27:32", | |
]; | |
echo "Arreglo antes de ordenar: "; | |
print_r($arreglo); | |
sort($arreglo, SORT_STRING); | |
echo "Arreglo DESPUÉS de ordenar: "; | |
print_r($arreglo); | |
/* | |
Salida: | |
Arreglo antes de ordenar: Array | |
( | |
[0] => 2019-07-30 07:00:00 | |
[1] => 2002-11-24 13:15:20 | |
[2] => 2007-10-29 15:27:32 | |
) | |
Arreglo DESPUÉS de ordenar: Array | |
( | |
[0] => 2002-11-24 13:15:20 | |
[1] => 2007-10-29 15:27:32 | |
[2] => 2019-07-30 07:00:00 | |
) | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment