|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2001-07-17 11:53 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 02 16:00:01 2025 UTC |
<?php $extensions=array(".htm",".asp"); $x=""; $numargs=count($extensions); for ($i=0;$i<=$numargs-1;$i++){ $x=$x."strstr(\$filename,\"".$extensions[$i]."\")"; if ($numargs>0 && $i!=$numargs-1){ $x=$x." || "; } } $validExtensions=$x; echo $validExtensions; $handle=opendir('.'); while (($filename = readdir($handle))!==false) { if (is_file($filename)){ $fd = fopen ($filename, "rb"); $contents = fread ($fd, filesize ($filename)); if (eval($validExtensions)){ echo $filename."<br>"; } fclose ($fd); } } closedir($handle); ?>