Welcome Guest, Not a member yet? Register   Sign In
Help with Looping through an object
#11

(11-12-2018, 01:06 AM)paulkd Wrote: Hi,

I got this answer from https://stackoverflow.com/questions/4282...ect-fields

Code:
$list = json_decode($json);

function cmp($a, $b) {
   return strcmp($a->data_amount, $b->data_amount);
}

usort($list->products, "cmp");

Unfortunately, this returns bool(true) instead of the original objects
Reply
#12

Hi enelson,

Can you show me your code?
Reply




Theme © iAndrew 2016 - Forum software by © MyBB