Last active
August 29, 2015 14:21
-
-
Save nathggns/c4dd0089aaef2bec35ce to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$json = file_get_contents('https://gist.githubusercontent.com/nathggns/051203c3d7e72159de0d/raw/9e368d3a99a219a7fc487d327b86ebd4f6c8ed53/results.json') or die('Cannot fetch data'); | |
$consts = json_decode($json, true) or die('Cannot decode data'); | |
echo array_reduce(array_values($consts), function($amount, $parties) { | |
return $amount + ($parties[0]['share'] < 0.5 ? 1 : 0); | |
}, 0); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment