十二月 20, 2016

PHP array 反轉陣列排列順序

反轉原陣列順序

$a=array(‘a’,’1′,’2′,’b’);
print_r(array_reverse($a));

顯示結果:
Array ( [0] => b [1] => 2 [2] => 1 [3] => a )


© UCAMC. All rights reserved.
Powered by CITIAR.