My string is like this $str="http://www.abc.com/tt.php?aa=http://www.xyz.com/abc.doc" I want to extract the second url out of it if the string is a normal link then the code should not change it,only if it has two http it shd extarct the second url of it Regards Alex