Hi!
While parsing w/pages I need to covert relative urls to absolute. I do this with my own functions, but bump into a problem from time to time. At last decided to explore some special functions like parse_url, but found this one isn't perfect too (no wonder but a simple fact ;) )
For example, the parsing page url is 'htt p:/ /www.site.com/NTE/home/en' , the next relative url to resolve among others is 'releases/en' (means href="releases/en")
parse_url dumps the next info about source page url: array(3) { ["scheme"]=> string(4) "htt p" ["host"]=> string(22) "www.site.com" ["path"]=> string(12) "/NTE/home/en" }
and info on the problem url: array(1) { ["path"]=> string(11) "releases/en" }
Actually the target page absolute url is: 'htt p:/ /www.site.com/NTE/releases/en'
And how I should calculate this url using the info above?
Are there any more perfect tools (php functions, scripts) to do this work?
Thank you.