public static function replaceUrl($content, $oldPrefix, $newPrefix)
    {
        $replacedUrl = preg_replace(
            '#(.*?)/' . preg_quote($oldPrefix, '#') . '(.*?)#',
            '$1/' . $newPrefix . '$2',
            $content
        );
    
        return $replacedUrl;
    }
public static function replaceUrl($content, $oldPrefix, $newPrefix)
    {
        $replacedUrl = preg_replace(
            '#(.*?)/' . preg_quote($oldPrefix, '#') . '(.*?)#',
            '$1/' . $newPrefix . '$2',
            $content
        );
    
        return $replacedUrl;
    }
public static function replaceUrl ( $ content , $ oldPrefix , $ newPrefix ) { $ replacedUrl = preg_replace ( '#(.*?)/' . preg_quote ( $ oldPrefix , '#' ) . '(.*?)#' , '$1/' . $ newPrefix . '$2' , $ content ) ; return $ replacedUrl ; }
Replace url in content

@param string $content
@param string $oldPrefix
@param string $newPrefix

@return string Content with replaced urls
Replace url in content