Hello guys, I was wondering if anyone could tell me how to read files from a folder (in php) and show them to the user. And if it’s possible, to show them in a table Thx in advance ??
[code=php]<?php $path = 'path/to/'; if(($dh = opendir($path)) !== false) { while(($file = readdir($dh)) !== false) { if($file != '.' && $file != '..') { $fp = fopen($file, 'rb'); $contents = fread($fp, filesize($file)); echo '<pre>' . htmlspecialchars($contents) . '</pre>'; fclose($fp); } } closedir($dh); } ?>[/code]
Help @Gert-Jan spread the word by sharing this article on Twitter...