RE: [PHP] R: File Uploads

From: Date: Fri, 14 Sep 2001 08:18:10 +0000
Subject: RE: [PHP] R: File Uploads
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-67345@lists.php.net to get a copy of this message
I'd use preg_match(). Something like should do the trick: if ($file != ".htaccess" && $file != "." && $file != ".." && !preg_match("/(.*)\.php/i", $file)) Niklas -----Original Message----- From: --- [mailto:flagzen@libero.it] Sent: 14. syyskuuta 2001 11:09 To: php-general@lists.php.net Subject: [PHP] R: File Uploads you can use strrchr to find the extension, like this: if ($file != ".htaccess" && $file != "." && $file != ".." && strrchr($file,".") != ".php") Try to see php manual, probably i mispelled it. ---------------------- Federico flagzenNO-SPAM@libero.it ---------------------- Christopher Cm Allen <callen@nocpop.net> wrote in message 008d01c13c6c$3a41a640$1dbea318@mn.mediaone.net... Greetings: Looking for a way to say *.php in this code: if ($file != ".htaccess" && $file != "." && $file != ".." && $file != ANY PHP FILE) I have tried *.php... Any Ideas? Thanks CCMA -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#67345) next »