Home  >  Article  >  Backend Development  >  simplexml_load_string对文本处理后,文本中的换行符的长度会变成1,怎么恢复成2呢?

simplexml_load_string对文本处理后,文本中的换行符的长度会变成1,怎么恢复成2呢?

WBOY
WBOYOriginal
2016-06-23 13:49:021006browse

simplexml_load_string对文本处理后,文本中的换行符的长度会变成1,怎么恢复成2呢?
文本中有换行符时,用上述函数处理后其中换行符的长度会变成1,怎么保持2呢


回复讨论(解决方案)

$str = str_replace(chr(13),chr(10),chr(13), $str);
??。

$str = str_replace(chr(10),chr(13).chr(10),$str)
这样貌似就可以了

$str = str_replace(chr(13),chr(10),chr(13), $str);
??。


我在你的基础上改了下,貌似可以了,非常感谢。

嗯嗯,忘?是chr(10)?是chr(13)
如??解?了???。

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn