Im trying to clean up xml data of illegal characters.
I need a pointer as to how to get a regex to perform this.
Here is my feable attempt ->

<?php

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

$foo = '<title>It\'s a test</title>';

//$bar = preg_replace('/[^\w\s<>\/]+/', '&apos;', $foo);
$bar = preg_replace('/(<title>)([\'])(<\/title>)/', '$1' . '&apos;' . '$3', $foo);

echo $bar;

?>

Im trying the 2nd way, because I want to only do this clean up between certain tags..
Thanks for any help you may provide.

--
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