|
Posted by Toby A Inkster on 02/20/07 08:16
A.Martini wrote:
> I have write a new function
>
> function cdataize($content)
> {
> $content = preg_replace('/\&\#([0-9]+);/','<![CDATA[&#\\1;]]>',$content);
> return($content);
> }
Entities can use hexadecimal notation too...
function cdataize($content)
{
$content = preg_replace('/\&\#([0-9]+);/','<![CDATA[&#\\1;]]>',$content);
$content = preg_replace('/\&\#x([0-9A-F]+);/i','<![CDATA[&#\\1;]]>',$content);
return($content);
}
There are also named entities, like "&emdash;", but I don't think RSS
defines any such entities apart from the five standard XML ones.
--
Toby A Inkster BSc (Hons) ARCS
Contact Me ~ http://tobyinkster.co.uk/contact
Geek of ~ HTML/SQL/Perl/PHP/Python*/Apache/Linux
* = I'm getting there!
[Back to original message]
|