How to echo an array in PHP?
Posted
by
Kaoukkos
on Stack Overflow
See other posts from Stack Overflow
or by Kaoukkos
Published on 2012-03-22T05:22:56Z
Indexed on
2012/03/22
5:29 UTC
Read the original article
Hit count: 120
The following code
$results = $facebook->api('/fql', array('q'=>'SELECT page_id, type FROM page_admin WHERE uid = me()'));
print_r($results);
returned me this array
Array
(
[data] => Array
(
[0] => Array
(
[page_id] => 204725966262837
[type] => WEBSITE
)
[1] => Array
(
[page_id] => 163703342377960
[type] => COMMUNITY
)
)
)
My question is how can I just echo the content without this structure? I tried
foreach ($results as $result) {
echo $result->type;
echo "<br>";
}
© Stack Overflow or respective owner