Reply to Re: xml_parse and entities and quotes

Your name:

Reply:


Posted by A.Martini on 02/19/07 22:29

A.Martini wrote:

Hello,

Analyzing more in depth the problem i discovered that I have to substitute
all the &#nnn; and &#nnnn; with their <![CDATA[&#nnn;]]> and <
[CDATA[&#nnnn;]]> so encoding will pass thru the parser properly and are
not substitued by ?.

Now the challenge is to find a regular expression to do the substitution of
all:

&#nnn; -> <![CDATA[&#nnn;]]>

and

&#nnnn; -> <![CDATA[&#nnnn;]]>


I have write a new function

function cdataize($content)
{
$content = preg_replace('/\&\#([0-9]+);/','<![CDATA[&#\\1;]]>',$content);
return($content);
}

This will solve the problem in a more elegant way :-)

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация