shobhitjain Posted November 21, 2009 Share Posted November 21, 2009 hey guys i am bit confused in this problem suppose i have this code<ul><li><a href="http://www.weatherbase.com/weather/weather.php3?s=57219&refer= ">Johnston Island</a><li><a href="http://www.weatherbase.com/weather/weather.php3?s=66019&refer= ">Midway Island</a></ul><ul><li><a href="http://www.weatherbase.com/weather/weather.php3?s=158319&refer= ">Palmyra Atoll</a><li><a href="http://www.weatherbase.com/weather/weather.php3?s=54219&refer= ">Wake Island</a></ul>i scrape this text from the webpage to my localhost using Php simple html Dom.now i have to split all these links ,such that when i click on Midway Island the page is redirected to www.mypage.com.i don't know about using regex ,so how do i split this code to extract url and change it to my url. Link to comment Share on other sites More sharing options...
justsomeguy Posted November 23, 2009 Share Posted November 23, 2009 There should be several examples of regular expressions online for finding URLs. Once you find the URLs you can use the PHP function parse_url to break it up and replace parts with what you want. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.