You have a function already for it:
http://php.net/manual/en/function.min.php
echo min(2, 3, 1, 6, 7); // 1
echo min(array(2, 4, 5)); // 2
echo min(0, 'hello'); // 0
echo min('hello', 0); // hello
echo min('hello', -1); // -1
Combine it with array_values if this fits better your needs.