multidimensional array data not displaying
-
Hello I’m having a little help displaying the data from my multidimensional array, I am hoping that someone may be able to help me out. This is my code.
$url = 'https://legacy.cafebonappetit.com/api/2/cafes?cafe=687'; $response = wp_remote_get( esc_url_raw( $url ) ); $slices = json_decode( wp_remote_retrieve_body( $response ), true ); if ($slices) { foreach ($slices as $slice) { echo '<p>Menu Name: '.$slice['cafes']['687']['name'].'</p><br/>'; echo '<p>Weekly menu status: '.$slice['cafes']['687']['days']['status'].'</p><br/>'; // insert more logic here } } echo "<pre>";var_dump($slices);echo "</pre>";
I can get it to display all using var_dump, but I can’t get individual element to display.
Any help would be appreciated?
Thanks,
Aaron
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘multidimensional array data not displaying’ is closed to new replies.