Jackson Jackson - 1 year ago 60
SQL Question

PHP: Get string from within Array?

I'm using facebook SDK and I'm trying to get a string from an array which is the facebook php sdk response.

Basically, I get the age_range from facebook and I need to get the value of age_range.

The age range always is an array for some strange reason.

It looks like this:

[age_range] => Array
[min] => 21

so, in my php I have this:

$age_range = $me['age_range'];

but when i insert this
into mysql database, I get the word
inserted into mysql database!

But all i need is the
or any other number that returns back from age range.

could someone please advise on this issue?

Thanks in advance.

Answer Source

As stated in my comment, simply change:

$age_range = $me['age_range'];


$age_range = $me['age_range']['min'];