You know how to do it, just do not know how to see the result. The sort()
function performs what you want on top of the array that you pass. Then you just print the array again after going through the function that everything will work out. You just can not print the function return because according to the documentation (you have to read it to learn, alias has to read everything to program, to use new sites, etc., read is the secret to evolve), it returns a booliano if it worked or failed. It does not return another sorted array.
<?php
$resultado = array();
for ($i = 0; $i <= 5; $i++) {
array_push($resultado, rand(1, 60));
}
print_r($resultado);
sort($resultado);
print_r($resultado);
See running on ideone .