title: Cannot using foreach loop with PHP exec() function?
body: <p>I am trying to find out the disk volume name.And my code is:</p>
  
  <pre><code>$diskVolume = array('m','r');
  foreach ($diskVolume as $volume) {
      echo $volume.' ';
      $cmd = 'fsutil fsinfo volumeinfo '.$volume.':';
      exec( $cmd,$getVolumeName);            
      echo $getVolumeName[0].'&lt;br /&gt; ';
  }
  </code></pre>
  
  <p>But my code seems only got the first item <strong>m's volume name</strong> and couldn't get the <strong>r</strong>.In other words ,the loop only get the first item's information..,</p>
  
  <p>Thank you very much!!</p>
  
  <p>information about fsutil:
  <a href="http://technet.microsoft.com/en-us/library/cc788080%28WS.10%29.aspx" rel="nofollow">fsutil</a></p>