i've been trying use sort() function rearrange array smallest largest.
this print_r of array came serialized data imploded:
array ( [0] => 127173 [1] => 127172 [2] => 127174 [3] => 127175 [4] => 127178 [5] => 127176 [6] => 127177 [7] => 127179 [8] => 127180 [9] => 127183 [10] => 127181 ) with sort() , asort() 1 returning.
try code... in fact sort function working fine.
$array = array ( '0' => 127173, '1' => 127172, '2' => 127174, '3' => 127175, '4' => 127178, '5' => 127176, '6' => 127177, '7' => 127179, '8' => 127180, '9' => 127183, '10' => 127181 ); sort($array); // <= sort array desc foreach( $array $key => $value ){ echo $key."\t=>\t".$value."\n"; } consider
sortfunction alters array , returns bool. see doc.
Comments
Post a Comment