Good morning.
I'm trying to consume a json in PHP but I'm having this problem:
Warning: Invalid argument supplied for foreach () in D: \ xampp \ htdocs \ api \ consume \ index.php on line 7
Array code - JSON
PHP code
<?php
$json_file = file_get_contents("http://localhost/api/carne/retornofim.php");
$json_str = json_decode($json_file, true);
$itens = $json_str['nodes'];
foreach ( $itens as $e )
{
echo $e['title']."<br>";
}
?>
Att