/* $text = 'ma poate ajuta cineva cu o expresie regulata care sa inlocuiasca targetul link-ului: link cu ceea ce am specificat mai sus ?';
$scr_url = 'myscript.php';
echo 'text initial: '.$text.'
';
echo 'text procesat: '.modify_urls($text,$scr_url);
function modify_urls($text_body,$script_url) {
preg_match_all("#\s(href|src|action|codebase|url)=([\"\'])?(.*?)([\"\'])?([\s\>])#i", $text_body, $matches, PREG_SET_ORDER);
foreach ($matches as $match) {
$uri = trim($match[3]);
$replace = ' ' . $match[1] . '=' . $match[2] . $script_url . '?url=' . $uri . $match[4] . $match[5];
$text_body = str_replace($match[0], $replace, $text_body);
return $text_body;
}
}
*/
?>