phantom php echo?
<p>im getting this error:</p>

<pre><code>Parse error: syntax error, unexpected T_ECHO in /home/labvc/public_html/AT/site/getimages.php on line 26
</code></pre>

<p>from this code:</p>

<pre><code>&lt;?php

echo '&lt;br /&gt;';
echo '&lt;div id=gallery&gt;';

function getDirTree($dir,$p=true) {
    $d = dir($dir);$x=array();
    while (false !== ($r = $d-&gt;read())) {
        if($r!="."&amp;&amp;$r!=".."&amp;&amp;(($p==false&amp;&amp;is_dir($dir.$r))||$p==true)) {
                $x[$r] = (is_dir($dir.$r)?array():(is_file($dir.$r)?true:false));
        }
    }

    foreach ($x as $key =&gt; $value) {
        if (is_dir($dir.$key."/")) {
                $x[$key] = getDirTree($dir.$key."/",$p);
        }
    }

    ksort($x);
    return $x;
}

$tree = getDirTree("./res/gallery/painting/");

foreach($tree as $element =&gt; $eval) {
    if (is_array($eval)) {
        foreach($eval as $file =&gt; $value) {
                if (strstr($file, "png")||strstr($file, "jpg")||strstr($file, "bmp")||strstr($file, "gif")) {
                        $item = $tree.'/'.$element.$file;
      $itemthumb = $tree.'/thumbs/'.$element.$file;
                        echo '&lt;a href="'.$item.'"&gt;&lt;img src="'.$itemthumb.'" alt="'.$file.'"/&gt;&lt;/a&gt;';
                }
        }
    }
}

echo '&lt;/div&gt;';


echo '&lt;br /&gt;';

echo 'tree: '.$tree.'&lt;br /&gt;';
echo 'element: '.$element.'&lt;br /&gt;';
echo 'file: '.$file.'&lt;br /&gt;';

$abc="res/gallery/painting";
$def="01.png";
echo'&lt;a href="'.$abc.$def.'"&gt;&lt;img src="'.$abc.'/thumbs/'.$def.'" alt="'.$def.'"/&gt;&lt;/a&gt;';

echo '&lt;br /&gt;';
</code></pre>

<p>line 26 is not an echo, theres not even an echo close to line 26</p>

<pre><code>foreach($tree as $element =&gt; $eval) {
</code></pre>

<p>Any ideas?</p>
