|
Plug-in PHP: 100 Power Solutions By Robin Nixon (McGraw Hill 2010, ISBN 978-0071666596) Home | About | Buy It |
Chapter 5: Plug-in 21 - Relative To Absolute URLAny project that needs to crawl web pages, whether their own or third party, needs a way to convert relative URLs into absolute URLs that
can be called up on their own, without reference to the page in which they are located. For example, the URL /sport/index.html means nothing at all when looked at on its own, and there is no way of knowing the URL was extracted from the web page http://server.com/news/.
Using this plug-in relative URLs can be combined with the referring page to create stand-alone, absolute URLs, such as http://server.com/sport/index.html. |