title: Convert a string of comma separated values into a JSON array
body: <p>How can I convert a string of comma separated values into valid json, using either php or jquery?</p>
  
  <p>The comma separated strings are stored in a database and are like this:</p>
  
  <p><code>Singapore,Andora,Australia</code></p>
  
  <p>The output I need is like this: <code>["Singapore","Andora","Australia"]</code></p>
  
  <p>I tried using php's <code>json_encode</code> on the string, but that does not render json the way I need it. It does this <code>"Singapore,Andora,Australia"</code></p>
  
  <p>Any way I could get this the way I want it?</p>