Skip to content

Instantly share code, notes, and snippets.

@pinscript
Created August 7, 2014 06:52
Show Gist options
  • Save pinscript/61e60ccd5e873bcc6930 to your computer and use it in GitHub Desktop.
Save pinscript/61e60ccd5e873bcc6930 to your computer and use it in GitHub Desktop.
<?php
$data = json_decode($json, true);
uasort($data['allresults'], function($a, $b) {
$aSalary = $a['results'][0]['salary'];
$bSalary = $b['results'][0]['salary'];
return $bSalary < $aSalary;
});
foreach($data['allresults'] as $item) {
printf("%s: %d<br />", $item['results'][0]['Name'], $item['results'][0]['salary']);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment