title: PHP Convert a string of comma separated values into another format without using a loop
body: <p>In php, if I had a string of comma separated data like this which came from a database:</p>
  
  <p><code>John,Paul,Ringo,George</code></p>
  
  <p>how could I convert it to something like this, without using a for loop or any extra processing. Does php have a function that can do this?</p>
  
  <pre><code>$str = 'John','Paul','Ringo','George';
  </code></pre>
  
  <p>I currently split the string using explode and then reformat it. Anyway to achieve this without doing that?</p>
  
  <p>The formatted string is sent to a SQL where it's used in a MySQL <code>IN()</code> function.</p>