I am a bit of a PHP newbie so this is probably easy but I just cant figure it out. I'm using a script that pulls info from the movie database 'TMDB' using there API.
The following code:
$playing = $tmdb_V3->nowPlayingMovies($page=1);
echo"<pre>";print_r($playing);echo"</pre>";
prints out this info:
Array
(
[dates] => Array
(
[minimum] => 2014-05-20
[maximum] => 2014-06-10
)
[page] => 1
[results] => Array
(
[0] => Array
(
[adult] =>
[backdrop_path] => /aBkkrhQS4rO3u1OTahywtSXu3It.jpg
[id] => 127585
[original_title] => X-Men: Days of Future Past
[release_date] => 2014-05-23
[poster_path] => /qKkFk9HELmABpcPoc1HHZGIxQ5a.jpg
[popularity] => 232.77188788256
[title] => X-Men: Days of Future Past
[vote_average] => 7.2
[vote_count] => 178
)
[1] => Array
(
[adult] =>
[backdrop_path] => /9bd6IFBMwSOINrEW8VIBxaS4cd9.jpg
[id] => 102651
[original_title] => Maleficent
[release_date] => 2014-05-30
[poster_path] => /1cFVCUYKSBuEUDoVftKvqcfuIgc.jpg
[popularity] => 57.46008792307
[title] => Maleficent
[vote_average] => 7.3
[vote_count] => 42
)
[2] => Array
(
[adult] =>
[backdrop_path] => /7mgKeg18Qml5nJQa56RBZO7dIu0.jpg
[id] => 137113
[original_title] => Edge of Tomorrow
[release_date] => 2014-06-06
[poster_path] => /zMP1PEvwH8Uy6jiIG1Qzp0svS1q.jpg
[popularity] => 56.13626675
[title] => Edge of Tomorrow
[vote_average] => 7.5
[vote_count] => 29
)
and so on.
What I would like to do is extract the information and save it as its own variable. so for example:
[0] => Array
(
[adult] =>
[backdrop_path] => /aBkkrhQS4rO3u1OTahywtSXu3It.jpg
[id] => 127585
[original_title] => X-Men: Days of Future Past
[release_date] => 2014-05-23
[poster_path] => /qKkFk9HELmABpcPoc1HHZGIxQ5a.jpg
[popularity] => 232.77188788256
[title] => X-Men: Days of Future Past
[vote_average] => 7.2
[vote_count] => 178
Would be the first movie so I can then save its [id] as $id
, the [original_title] as $title
and so on, so I can call on those variables any where on the page.
Is this possible?
I basically want to get all the info from the database and display it in a PHP file but not by printing the array
any info will be very much appreciated.