title: Single dimensional array from a while loop in php
body: <p>I need to retrieve the value of an array which is inside a while loop and use it outside . </p>
  
  <p>I was able to do it with this code</p>
  
  <pre><code>while($row2 = mysql_fetch_assoc($result2))
      {
  
          $xyz[] = $row2;
      } 
  echo $xyz;
  </code></pre>
  
  <p>But I am getting a 2 dimensional array when I print $xyz . can someone tell me how to retrieve the array from the while loop so that it is still a single dimension array</p>
  
  <p>I appreciate any kind of help </p>