3v4l.org

run code in 300+ PHP versions simultaneously
<?php $json_data = array ( 'data' => array ( 0 => array ( 'title' => 'currency1', 'tickers' => array ( 0 => 'USD' ), ), 1 => array ( 'title' => 'currency2', 'tickers' => array ( 0 => 'USD', 1 => 'EUR' ), ), 2 => array ( 'title' => 'currency3', 'tickers' => array ( 0 => 'USD' ), ) ) ); foreach ($json_data['data'] as $key => $story) { $tickers = $story['tickers']; if (count($tickers) != 1) continue; $title = $story['title']; echo "$title Key is $key and tickers is {$tickers[0]}\n"; }

This is an error 500

Value for `_results` contains invalid data `array`


preferences:
217.45 ms | 2007 KiB | 8 Q