I'm trying to analyze some government data. Here's the JSON
{
"results": [
{
"bill_id": "hres311-113",
"bill_type": "hres",
"chamber": "house",
"committee_ids": [
"HSHA"
],
"congress": 113,
"cosponsors_count": 9,
"enacted_as": null,
"history": {
"active": false,
"awaiting_signature": false,
"enacted": false,
"vetoed": false
}
And here is the php
foreach($key['results'] as $get_key => $value){
$bill_buff .= 'Bill ID: ' . $value['bill_id'] . '<br/>';
$bill_buff .= 'Bill Type: ' . $value['bill_type'] . '<br/>';
$bill_buff .= 'Chamber: ' . $value['chamber'] . '<br/>';
$bill_buff .= 'Committee IDs: ' . $value['committee_ids'] . '<br/>';
$bill_buff .= 'Congress: ' . $value['congress'] . '<br/>';
$bill_buff .= 'Cosponsor Count: ' . $value['cosponsors_count'] . '<br/>';
$bill_buff .= 'Enacted As: ' . $value['enacted_as'] . '<br/>';
$bill_buff .= 'History: {' . '<br/>';
$history = $value['history'];
$bill_buff .= 'Active: ' . $history['active'] . '<br/>';
$bill_buff .= 'Awaiting Signature: ' . $history['awaiting_signature'] . '<br/>';
$bill_buff .= 'Enacted: ' . $history['enacted'] . '<br/>';
$bill_buff .= 'Vetoed: ' . $history['vetoed'] . '}<br/>';
}
It won't display History{Active, Awaiting Signature, Enacted, or Vetoed}. I've tried to do $value['history']['active']
, as well as creating a variable to catch the info and then using that $catch['active']
but still can't get a result.
This has been annoying me for over a week now and I've looked long enough to decide I need to ask for help. Can anyone assist me?
P.S. I've also print_r($history) and go it to show me:
Array ( [active] => [awaiting_signature] => [enacted] => [vetoed] => )