Welcome Guest, Not a member yet? Register   Sign In
php preg_replace function
#5

[eluser]basty_dread[/eluser]
Hi sophistry,
Thanks for helping on my topic preg_replace function
its really a big help..

i need your help again on this..
if you notice that it will surely match the word enclosed in <h2> tag..
is there a way it could exclude it from being replaced?

Code:
$string = "the quick brown fox jumps over the lazy dog, Brown Fox. <h2>The Brown Fox</h2>";
$find = "brown fox";
$save = preg_replace('/b('.$find.')b/ie', "str_replace(' ', 'x', '$1')", $string);
print_r($save);


Messages In This Thread
php preg_replace function - by El Forum - 03-03-2010, 02:55 AM
php preg_replace function - by El Forum - 03-03-2010, 09:27 AM
php preg_replace function - by El Forum - 03-03-2010, 06:50 PM
php preg_replace function - by El Forum - 03-04-2010, 09:20 AM
php preg_replace function - by El Forum - 03-07-2010, 06:31 PM
php preg_replace function - by El Forum - 03-07-2010, 09:39 PM
php preg_replace function - by El Forum - 03-07-2010, 11:14 PM
php preg_replace function - by El Forum - 03-07-2010, 11:16 PM
php preg_replace function - by El Forum - 03-07-2010, 11:21 PM
php preg_replace function - by El Forum - 03-07-2010, 11:24 PM
php preg_replace function - by El Forum - 03-07-2010, 11:40 PM
php preg_replace function - by El Forum - 03-07-2010, 11:49 PM
php preg_replace function - by El Forum - 03-07-2010, 11:58 PM
php preg_replace function - by El Forum - 03-08-2010, 12:06 AM
php preg_replace function - by El Forum - 03-08-2010, 01:05 AM
php preg_replace function - by El Forum - 03-08-2010, 07:34 AM
php preg_replace function - by El Forum - 03-08-2010, 06:16 PM
php preg_replace function - by El Forum - 03-08-2010, 09:55 PM
php preg_replace function - by El Forum - 03-09-2010, 03:16 AM
php preg_replace function - by El Forum - 03-09-2010, 06:43 AM
php preg_replace function - by El Forum - 03-09-2010, 07:36 PM
php preg_replace function - by El Forum - 03-09-2010, 07:46 PM



Theme © iAndrew 2016 - Forum software by © MyBB