I have data like this:
Array
(
[data] => Array
(
[0] => Array
(
[name] => xxxxxxxxxxxx
[category] => yyyyyyyy
[id] => 12345666666
[data] => ABCDE
)
[1] => Array
(
[name] => ZZZZZZZZZZZ
[category] => JJJJJJ
[id] => 88888888888888
[data] => ABCDEHIJK
)
)
)
I need to get the data from the first array only. I don't want to use a loop. I have tried this:
$name = $data['data'][0]['name'];
but that doesn't get the name. Does anyone know how I can get the specific name only from the first array?
EDIT** my code:
$movie_details_tmdb = $tmdb->searchMovie($search);
$movie_details_tmdb_results = json_decode(json_encode($movie_details_tmdb), true);
$id = $movie_details_tmdb_results['results'][0]['id'];
it's in the same format as the code above.