How do you select an array within an array in a json file?
I managed to display using intval() but it only displays the first number.
The JSON file looks like this:
{
"arrayone": [{
"array": ["15000", "20000", "30000"]
}, {
"array": ["20000", "40000", "80000"]
}]
}
And my PHP code looks like this:
<input value="<?php echo $array["array"] ?>" />
Returns me with Array while
<?php echo intval($array) ?>
Returns me with 1.
However I was able to display the values in each array on a <td> using:
<td>
<?php
foreach($arrayone->array as $int){
echo $int . ",";
}?>
</td>
Which returns me with 15000, 20000, 30000