its a mystery to me why this is happening. so here is the 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";
}
so If $file= video.mp4 and $file_title=’file name’.$file; it would look like this:
‘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
if anyone has any idea what’s happening please let me know. Thanks.
You are listing the
.and..directories, useis_file()to check so the entry is really a file and not a directory:Here you can read more about the
dotdirectories: There’s a lot in the dot