title: How to add multiple tags to a post in Tumblr using the API with PHP?
body: <p>I am posting on Tumblr using its API. I can successfully post and add a single tag to any post but I am having trouble while adding multiple tags.</p>
  
  <p>This is what they suggest on their guide:</p>
  
  <pre><code>{
  "response": {
  "posts": [
       {
          "blog_name": "blogname",
  
          "type": "text",
          "tags": [
             "tumblrize",
             "milky dog",
             "mini comic"
          ],
          "title": "A title",
          "body": "Some text for the post"
       },
       ...
    ]
   }
  }
  </code></pre>
  
  <p>I do the following in PHP:</p>
  
  <pre><code>$data = array('title' =&gt; 'My Title', 'body' =&gt; 'My Content', 'tags' =&gt; 'A Single Tag');
  $client-&gt;createPost($blog_n, $data);
  </code></pre>
  
  <p>To use multiple tags I wrote the following code:</p>
  
  <pre><code>$data = array('title' =&gt; 'My Title', 'body' =&gt; 'My Content', 'tags' =&gt; array('A', 'Single', 'Tag'));
  </code></pre>
  
  <p>but that raises an exception.</p>
  
  <p>Can anyone please help me to understand how to post multiple tags.</p>
  
  <p>This is the exception I get:</p>
  
  <blockquote>
    <p>PHP Fatal error:  Uncaught Tumblr\API\RequestException: [500]:
    Internal Server Error</p>
    
    <p>thrown in
    /home/freadioc/public_html/socialmedia/tumblr/lib/Tumblr/API/Client.php</p>
  </blockquote>
  
  <p><a href="https://www.tumblr.com/docs/en/api/v2" rel="nofollow">Link to the documentation</a>.</p>
  
  <p><strong>UPDATE</strong></p>
  
  <p>After the suggestion in the answer below, I used the following code:</p>
  
  <pre><code>$data = array('title' =&gt; 'My Title', 'body' =&gt; 'My Content', 'tags' =&gt; 'Multiple', 'Tags'));
  </code></pre>
  
  <p>Using the code above only results in one tag attached to the post i.e. <code>Multiple</code>. I think that's because the associative array itself has comma separated values.</p>