<?php $string = 'bla bla bla http://google.com bla bla'; $fixedString = preg_replace_callback( '#[-a-zA-Z0-9@:%_\+.~\#?&//=]{2,256}\.[a-z]{2,4}\b(\/[-a-zA-Z0-9@:%_\+.~\#?&//=]*)?#si', function($matches) { return 'http://exmaple.com/visit/' . base64_encode($matches[0]); }, $string ); var_dump($fixedString);
You have javascript disabled. You will not be able to edit any code.