Re: Not found regex

From: Date: Mon, 04 Aug 2008 14:54:35 +0000
Subject: Re: Not found regex
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-277670@lists.php.net to get a copy of this message
<?php $file = '/example/hello.php'; $info = pathinfo($file); $not_allowed = array('php', 'pt', 'exe'); if (!in_array(strtolower($info['extension']), $not_allowed)) { // do something } // why use a regex? ?> On Mon, Aug 4, 2008 at 4:44 PM, Manoj Singh <manojsingh2121@gmail.com> wrote: > Hello All, > I have to create the regular expression to allow all the file extensions > except the specified extension. > > Suppose I want to allow extensions with php, so the regex is: ^.+\.php$ > > But here i need the regex which allows all the extensions except php. > > > I will appreciate any help. > > Best Regards, > Manoj Kumar Singh >

« previous php.general (#277670) next »