Hello. I was trying to sort values of an array and something is very different from everything I knew so far.
Code is:
$files_list = array();
array_push($files_list,"0.jpg");
array_push($files_list,"3.jpg");
array_push($files_list,"1.jpg");
array_push($files_list,"2.jpg");
arsort($files_list);
echo $files_list[0];
I was expecting last line to echo "3.jpg" but it keeps returning "0.jpg" , I tried all kind of sort/arsort, nothing retruns that greatest value, what am I doing wrong?
I managed to find a solution by end($array_name), but still what was wrong with the above code?