开发者

XML not parsing correctly for no clear reason

I have my XML feed being created from an associative array.

Using new DOMDocument('1.0','UTF-8');

and it was working fine until I made some changes to the methods used to convert it from iso-8895-1 to UTF-8.

The character being flagged up is the letter R, but I have gone into the file via ftp and changed it manually (deleted and retyped r in case of any errors).

I changed it from $summ = str_replace(chr(10),"",$summ); to $summ = str_replace(array("\n", "\r", "\r\n"),"",$summ); but as you can see below I have changed it back and nothing. I have also set DOMDocument to formatoutput=false, because it was previously set on true, but it all that did was move the problem to a different letter r, both are on the end of words?????

//$summ = str_replace(array("\n", "\r", "\r\n"),"",$summ);开发者_如何学C
    $summ = str_replace(chr(10),"",$summ);
/*$v = str_replace(" "," ",$v);
$v = str_replace("  ","",$v);*/
$summ = iconv("ISO-8859-1", "UTF-8//TRANSLIT",$summ);
$summ = str_replace("£","£",$summ);
//$summ = htmlentities($summ, ENT_QUOTES, "UTF-8");
$this->summary = addslashes($summ);


Sorry for the unclear question but I couldn't show code for reasons of the output beind sensitive.

Anyway, the problem was htmlentities, and htmlspecialchars caused the same problem, without them it works fine.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜