HI,
first of all thanx for replying. i used u r eregi_replace function but it didnt gave me the correct answer i was looking for.this is the condition,
@$text="<img src=\"images/aaa.jpge\" height='11'> kjhkjh<img src=\"aaa.jpge\" height='11'> bbbb <img src='aaa.jpge' height='11'> lkjhkljl <img src=aaa.jpge height='11'>";
$text1 = eregi_replace('(src=("|\')?)(.*)("|\')?', '\1http://domain.com\2\3',$text);
print @$text1;
but it gave me the output as,
<img src="http://domain.com"images/aaa.jpge height='11'> kjhkjh<img src="aaa.jpge" height='11'> bbbb <img src='aaa.jpge' height='11'> lkjhkljl <img src=aaa.jpge height='11'>
but this is not what i wanted. then i did some changes in u r code and wrote my own condition and hopefully it worked. but there is a drawback. here is the code i wrote and the out put i got,
@$text="<img src=\"images/aaa.jpge\" height='11'> kjhkjh<img src=\"aaa.jpge\" height='11'> bbbb <img src='aaa.jpge' height='11'> lkjhkljl <img src=aaa.jpge height='11'>";
$text1 = eregi_replace("src=(\"|')*(\"|')|src=|background=(\"|')*(\"|')|background=", "\\0www.domain.com/\\1",$text);
print @$text1;
in above code i replace both src and background properties with domain name.
OUTPUT
<img src="www.domain.com/images/aaa.jpge" height='11'> kjhkjh<img src="www.domain.com/aaa.jpge" height='11'> bbbb <img src='www.domain.com/aaa.jpge' height='11'> lkjhkljl <img src=www.domain.com/aaa.jpge height='11'>
the drawback is,
*)if the src or background already had the domain name then it will replace again where as i dont want to do anything in that case.
eg:<img src="www.domain.com/http://domain.com/images/aaa.jpge" height='11'>
does anybody no how to solve this problem.
every comments highly welcome.
thanx in advance,
regards,
niroshan