HI i want to sort an array of objects , it is in the form of array which has objects and each objects has key,value , i want to sort the objects based on value, the problem is t
Try following (I assume that you want to ignore spaces in numbers):
uasort($yourArray, function($a, $b) { $a->value = str_replace(' ', '', $a->value); $b->value = str_replace(' ', '', $b->value); return (int)$a->value - (int)$b->value; });