Welcome Guest, Not a member yet? Register   Sign In
preg_replace function problem
#13

[eluser]basty_dread[/eluser]
do you have a testing server like xampp?

i tried to modify it again just removing some values and it turned good, but it removes the spacing between then

can you try this?
Code:
$find = "web design";
$string = "WEB DESIGN Web Design web design <a href='yahoo.com'>web design google</a> las vegas";
$finalstring = preg_replace('/(^|[^<a.*?&gt;])('.$find.')\b/iU', '<a href="http://google.com">\2</a>', $string,-1,$i);
echo $finalstring;
echo '<br />'.$i;


Messages In This Thread
preg_replace function problem - by El Forum - 02-16-2010, 11:23 AM
preg_replace function problem - by El Forum - 02-16-2010, 09:28 PM
preg_replace function problem - by El Forum - 02-16-2010, 09:37 PM
preg_replace function problem - by El Forum - 02-16-2010, 09:39 PM
preg_replace function problem - by El Forum - 02-16-2010, 10:26 PM
preg_replace function problem - by El Forum - 02-16-2010, 10:39 PM
preg_replace function problem - by El Forum - 02-16-2010, 10:48 PM
preg_replace function problem - by El Forum - 02-16-2010, 10:54 PM
preg_replace function problem - by El Forum - 02-16-2010, 11:21 PM
preg_replace function problem - by El Forum - 02-16-2010, 11:35 PM
preg_replace function problem - by El Forum - 02-17-2010, 12:18 AM
preg_replace function problem - by El Forum - 02-17-2010, 12:22 AM
preg_replace function problem - by El Forum - 02-17-2010, 12:35 AM
preg_replace function problem - by El Forum - 02-17-2010, 12:54 AM
preg_replace function problem - by El Forum - 02-17-2010, 01:52 AM



Theme © iAndrew 2016 - Forum software by © MyBB