title: Fetch column name from SQL QUERY STRING in PHP
body: <p>I want to fetch the alias column names from a query. Here I have not executed the query yet. The query is just in string format.</p>
  
  <pre><code>$query= "select id as id,name as 'Full_Name',caddress as 'Company_Address',paddress as 'Permenant_Address' from users"
  </code></pre>
  
  <p>From above query I want results like: id, Full_Name, Company_Address, Permenant_Address </p>
  
  <p>I have tried to make it using explode function but it gives quite different results as I expect.</p>
  
  <pre><code>print_r(explode('as',$str));
  
  O/P: Array ( [0] =&gt; select id [1] =&gt; id,name [2] =&gt; 'Full_Name',caddress [3] =&gt; 'Company_Address',paddress [4] =&gt; 'Permenant_Address' from users )
  </code></pre>
  
  <p>How to achieve the exact output I wanted?</p>