When I am adding same unit of number in "num". eg(0-9). It is sorting my array. But if any of the "num" value contains a different unit of digits, the sorting fails. eg(4,7,2,1) this will work. (7,12,76,2) this will fail.
$stack = array(array("Price" => $op,"num" => $noi),
array("Price" => $op1,"num" => $noi1),
array("Price" => $op2,"num" => $noi2),
array("Price" => $op3,"num" => $noi3));
function cmp($a, $b)
{
return strcmp($a["num"], $b["num"]);
}
usort($stack, "cmp");