How about formatting with some CSS.
Aug 13, 2018
4
Level 2
Vanilla PHP Code Review
Hi All,
I hacked together a vanilla PHP script that takes files uploaded to a folder and displays them on a webpage.
Basically i am making a very light weight CMS for a small project, wanted some advice/criticisms on this script and if there is a better way to do this
$dir = '/test/images';
//scan the directory
$files = scandir($dir, 0);
//remove . and .. from scandir
$files = array_diff($files, array('.','..'));
//for each filename in the directory place in html
foreach ($files as $file)
{
echo ('<img src="images/' .$file. '">');
}
Please or to participate in this conversation.