PHP - displaying just PHP files from a directory and sub directories
<p>This is my first project using PHP and I've been stuck on this for almost 2 days now!
I want to get all my PHP files from a directory and any sub directories and display them in iframes.
I've managed to get it to display all the files in the directory, but I only want the PHP files, please see below. Thanks in advance for any help/advice.</p>

<pre><code>&lt;?php
$path[] = 'work/*';

while(count($path) != 0)
{

$v = array_shift($path);
foreach(glob($v) as $item)
{
    if (is_dir($item))
        $path[] = $item . '/*';
    elseif (is_file($item))
    {
         printf(
  "&lt;iframe width=420 height=150 frameborder=0 src='$item'&gt;&lt;/iframe&gt;",
  ($file),$target);

    }
}
}
?&gt;
</code></pre>
