Re: Hide Files
| From: | Ron Brogden | Date: | Mon, 19 Feb 2001 22:37:50 +0000 |
| Subject: | Re: Hide Files | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-6762@lists.php.net to get a copy of this message | ||
At 04:22 PM 2/19/2001 -0600, you wrote:
while ($file_name = readdir($dir)) { if (($file_name != ".") && ($file_name != "..") && ($file_name !="*.php") && ($file_name !="main.gif") ) how come that still displays all the *.php files?You cannot use wildcards in this comparison: $file_name !="*.php" That literally is looking for a file called "*.php". Instead, use something like: "php" != substr($filename,strlen($filename)-4,3) I might be off on my numbers there but something like that should do. Probably best not to use regular expressions due to the extra overhead. Cheers -----------------------------------------------------------------------------
Island Net AMT Solutions Group Inc. Telephone: 250 383-0096 1412 Quadra Toll Free: 1 800 331-3055 Victoria, B.C. Fax: 250 383-6698 V8W 2L1 E-Mail: support@islandnet.com Canada WWW: http://www.islandnet.com/-----------------------------------------------------------------------------