repeating text after using opendir/readdir functions
<p>its a mystery to me why this is happening. so here is the code:</p>

<pre><code>$dir = 'test/';
$de = opendir($dir);
if ($de) {
    while (($file = readdir($de)) !== false) {
        $path = $dir . $file;
        $file_title = 'this text gets repeated three times, each followed by a dot' . $file;
        echo $file;
    }
} else {
    echo "invalid directory";
}
</code></pre>

<p>so If $file= video.mp4 and $file_title='file name'.$file; it would look like this: </p>

<p>'file name.file name.file namevideo.mp4' and if there were no string before the variable, ie $file_title=$title there would be three dots before the variable like this: ...video.mp4</p>

<p>if anyone has any idea what's happening please let me know. Thanks.     </p>
