So I am trying to build a script that scans a directory and returns random images to be used as backgrounds.
The php looks like this:
$dir = \"views
'.' and '..' are returned for current and parent directory. You can filter them:
while (false !== ($filename = readdir($dh))) { if ($filename != '.' && $filename != '..') $files[] = $filename; }