if preg_match href is matches url matches url base64_encode url preg_r

1
2
3
4
5
if(preg_match('|href="(.*?)">|is', $f, $matches)) {
$url = $matches[1];
$url = base64_encode($url);
$f = preg_replace('#href="(.*?)">#is', 'href="'.$url.'">', $f);
}