Re: ereg help!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



steve wrote:
On Tuesday 08 January 2008 20:30:29 Chris wrote:
I 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


$out = basename($file, ".html") . ".com";

fairly limited i think, but simple.

--
Regards,
Anup Shukla

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux