Php 如何在另一个数组中使用数组值
我的Facebook应用程序通过http帖子向用户墙发布故事:Php 如何在另一个数组中使用数组值,php,arrays,multidimensional-array,Php,Arrays,Multidimensional Array,我的Facebook应用程序通过http帖子向用户墙发布故事: $args = array('access_token' => $ACCESS_TOKEN, 'message' => 'testing message', 'picture' => $appin_logo, 'link' => $appin_canvas_url, 'name' => $ap
$args = array('access_token' => $ACCESS_TOKEN,
'message' => 'testing message',
'picture' => $appin_logo,
'link' => $appin_canvas_url,
'name' => $appin_name,
'caption' => $post_score,
'description' => $post_rfs,
);
$ch = curl_init(); $url = 'https://graph.facebook.com/me/feed'; curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_HEADER, false); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $args); $data = curl_exec($ch); curl_close($ch);
这一切都很好,除了一件事:$post_rfs是一个数组。我想以一种简洁的方式输出它的值,每个值后面都有一个逗号,也就是说,我应该怎么做
提前感谢。试试这个:
implode(', ', array_values($post_rfs));