]> Relative to Absolute URL PHP « MOleYArd (MOYA) blog

About

This blog mostly presents different approaches, methods and practices in software and web development, but also contains some "out of main topic" articles. MOYA (MOleYArd) products are presented here as well.

Follow

 


Valid XHTML 1.0 Transitional

Relative to Absolute URL PHP

ZIP file which contains PHP files with functions can be downloaded here

The file includes these 2 functions:

convertRelativeToAbsoluteURL($baseAbsoluteURL, $relativeURL) – returns converted absolute URL from $relativeURL according $baseAbsoluteURL
convertCSSRelativeURLsToCSSAbsoluteURLs($baseAbsoluteURL, $cssContent) – returns modified CSS content with relative URLs inside url() sections replaced with absolute URLs according $baseAbsoluteURL

These functions were originally pubslihed on http://www.moyablog.com/2011/10/19/how-to-convert-relative-urls-to-absolute-urls-in-websites-using-php/