title: Convert SplFileInfo to String
body: <p>I'm using a DirectoryIterator to get a folder's contents, and it works just fine :</p>
  
  <pre><code>$iterator = new RecursiveIteratorIterator(new RecursiveDirectoryIterator(__DIR__ . $this-&gt;certificate), RecursiveIteratorIterator::SELF_FIRST);
  
  foreach ($iterator as $key =&gt; $value) {
      array_push($files, $value);
  }
  unset($value);
  </code></pre>
  
  <p>But my <code>$files</code> result when printed it isn't a string but a STD Class. How could I convert that output as a string ( in case there's only one file ) or to an array ?</p>
  
  <p><strong>EDIT :</strong> This would be the result I get :</p>
  
  <pre><code>{ [0]=&gt; object(SplFileInfo)#5 (2) { ["pathName":"SplFileInfo":private]=&gt; string(101) "C:\Users\rgr\Apache\htdocs\Roland Groza [ 3.0 ]\class\mongohq/certificate\GTECyberTrustGlobalRoot.crt" ["fileName":"SplFileInfo":private]=&gt; string(27) "GTECyberTrustGlobalRoot.crt" } }
  </code></pre>