Re: Patterns

From: Date: Thu, 07 Jun 2007 16:12:52 +0000
Subject: Re: Patterns
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-256290@lists.php.net to get a copy of this message
On 6/7/07, Steve Marquez <smarquez@marquez-design.com> wrote:
Greetings. I just want to say thanks for the help over the past couple of days. I am trying to get a form to delete a file. If the file ends in .php, then I want it to unlink from a certain folder. However, if the file ends in .html or .htm, I want it to unlink from another folder. Is there any way to do this? Thanks, -- Steve M.
<? $extension = str_replace('.','',strtolower(strrchr('installer.php',"."))); if($extension == "php") { // Do your unlink() routine for PHP here. } elseif(strstr($extension,"htm")) { // Do your unlink() routine for .htm/.html files here.... will also do .phtml, etc. } ?> -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107

« previous php.general (#256290) next »