Re: ereg help!
| From: | Anup Shukla | Date: | Wed, 09 Jan 2008 10:08:24 +0000 |
| Subject: | Re: ereg help! | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-266954@lists.php.net to get a copy of this message | ||
steve wrote:
On Tuesday 08 January 2008 20:30:29 Chris wrote:$out = basename($file, ".html") . ".com"; fairly limited i think, but simple. -- Regards, Anup ShuklaI usually use preg_* functions so here's my go:echo preg_replace('/\.php$/', '.com', $file);The '$' at the end makes sure it's a .php file and won't cause problems with files like xyz.php.txt .(otherwise I'd just use a straight str_replace).Thanks Guess i was just trying to over think it. Have not done much with files. Steve