开发者

php variable ask ques

开发者 https://www.devze.com 2023-03-31 17:09 出处:网络
My goal is to grab the name of a page by querying the page ID. And then st开发者_开发知识库ore it in a variable.

My goal is to grab the name of a page by querying the page ID. And then st开发者_开发知识库ore it in a variable.

The current code I have for doing part of this is below, however as you can see the only thing I've done with the data is print it.

CODE:

$facebook = new Facebook(array(
'appId' => 'XXXXXXXXXX',
'secret' => 'XXXXXXXXXXXXXXXXXXXXXXXXXXX',
'cookie' => true,
));

$fql = "SELECT name from page WHERE page_id='$textfield'";

$response = $facebook->api(array(
'method' => 'fql.query',
'query' =>$fql,
));

print_r($response);

OUTPUT:

Array ( [0] => Array ( [name] => pagename ) )

I want just the plaintext of the pagename stored in a variable, not this Array ( [0] => Array ( [name] =>...))


Here how you retrieve it:

echo $response[0]['name'];
0

精彩评论

暂无评论...
验证码 换一张
取 消