title: How to convert an array to JSON format
body: <p>I have a string array, e.g.</p>
  
  <pre><code>p[]={"John","Kevin","Lex"}  
  </code></pre>
  
  <p>I want to convert it to JSON so that the data appears in key-value pair like:</p>
  
  <pre><code>{
      "name":"John",       
      "name":"Kevin"
  }
  </code></pre>
  
  <p>How can I achieve that? </p>