admin Level: Administrator

 Registered: 04-04-2002 Posts: 35
|
replace _blank with _top using eregi_replace
hello frinds,
I need a code to replace all the links pointing to a specific site with target="_blank" with the same URL but with target="_top"
i.e.
I have a string with the post made my a user, all links related to external sites will open in a new window but the links related to the same site of the forum will need to open in the same window...
if we have "[...] <a href="http://www.andreavb.com/anypage.html" target="_blank"> [...]" we need to produce a string with _blank replaced with _top but only if the related link starts with "http://www.andreavb.com" all other links related to external sites will keep the _top option
how can I write a replace function to do this?
____________________________
AndreaVB
|