I have a php array like :
myarr[1] = \"1\", myarr[2] = \"1.233\", myarr[3] = \"0\", myarr[4] = \"2.5\"
the values are actually strings but
You can convert your strings to real numbers (floats) and sort them afterwards:
foreach ($yourArray as $key => $value) { $yourArray[$key] = floatval($value); } sort($yourArray, SORT_NUMERIC);