• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2019 MyBB Group.