$URL = "https://casascius.uberbills.com/api/?status=active&type=100"; $ch = curl_init(); $timeout = 3; curl_setopt ($ch, CURLOPT_URL, $URL); curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ch, CURLOPT_CONNECTTIMEOUT, $timeout); $file_contents = curl_exec($ch); curl_close($ch); $LENGTH = strlen($file_contents); if ($LENGTH > 0) { $jsonIterator = new RecursiveIteratorIterator( new RecursiveArrayIterator(json_decode($file_contents, TRUE)), RecursiveIteratorIterator::SELF_FIRST); echo "
Address | Type | Active |
$val | "; } elseif (($key == "type") ) { echo "$val | "; } elseif (($key == "active") ) { echo "$val |