Code snippet ->
<?php

header('Content-type: text/plain');

$foo = '<img src="images/php.png"> <img src="images/apache.png">';

echo "$foo\n";


$path = '../../../';
$bar = preg_replace('/(<img src=")(.*">)/', "$1" . $path . "$2", $foo);

echo $bar;

?>

The second image doesn't get affected by preg_replace(). But if I break $foo into multiple lines like ->
$foo = '<img src="images/php.png">
<img src="images/apache.png">';

It works...
Any tips would be appreciated...
Thanks

--
Gerard Samuel
http://www.trini0.org:81/
http://dev.trini0.org:81/



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to