public static function to_absolute_attribute($attribute, $content, $base_url = null)
    {
        return preg_replace('/('.$attribute.'=[\'"])\//', '$1'.rtrim($base_url, '/').'/', $content);
    }
public static function to_absolute_attribute($attribute, $content, $base_url = null)
    {
        return preg_replace('/('.$attribute.'=[\'"])\//', '$1'.rtrim($base_url, '/').'/', $content);
    }
public static function to_absolute_attribute ( $ attribute , $ content , $ base_url = null ) { return preg_replace ( '/(' . $ attribute . '=[\'"])\//' , '$1' . rtrim ( $ base_url , '/' ) . '/' , $ content ) ; }
Convert an attribute strigng from a relative to absolute, by providing a base_url.

@param string $attribute name of the attribute, e.g. src, href
@param string $content   the string where to do the change
@param string $base_url

@return string
Convert an attribute strigng from a relative to absolute by providing a base_url .