2010-12-12 8 views
1

Mon application Facebook publie une histoire sur le mur de l'utilisateur avec un poste http:Comment utiliser les valeurs de tableau dans un autre tableau

$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); 

Cela fonctionne très bien, sauf pour une chose: $ post_rfs est un tableau. Je voudrais sortir ses valeurs d'une manière ordonnée, avec une virgule après chaque valeur. Que dois-je faire?

Merci d'avance.

Répondre

2

Essayez ceci:

implode(', ', array_values($post_rfs)); 
+0

C'est génial, merci !! – Ben

Questions connexes