title: Tagging friends on facebook Via Graphs
body: <p>I am Trying to Tag a picture and posting it through graphs However, when I remove the <code>'tags'    =&gt; $tags</code> from below, it works. Otherwise I get this error:</p>
  
  <pre><code>Array ( [error] =&gt; Array ( [message] =&gt; (#100) param tags must be an array. [type] =&gt; OAuthException [code] =&gt; 100 ) )
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  $tags = array(
      'to' =&gt; $_SESSION['my_fb_id'],
      'x' =&gt; 0,
      'y' =&gt; 0
  );
  
   $tag[]= $tags ;
  //
  //upload photo
  $file = 'imgtmp/save_as_this_name.jpg';
  $args = array(
      'message' =&gt; 'This is my Picture',
      'tags' =&gt; $tag, // IF this line is removed ,It works!
  );
  $args[basename($file)] = '@' . realpath($file);
  $ch = curl_init();
  $url = 'https://graph.facebook.com/me/photos?access_token=' . $_SESSION['access_token'];
  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);
  print_r(json_decode($data, true));
  ?&gt;
  </code></pre>