欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  后端开发

PHP中关于strstr函数查找 /n特殊字符?

程序员文章站 2024-01-31 22:44:34
...

我现在的代码 找不到 /n 字符

PHP中关于strstr函数查找 /n特殊字符?

PHP中关于strstr函数查找 /n特殊字符?

请问如何找到嗯?


扔上来的代码

$xml = simplexml_load_file("ZH-CNstrings.xml");

// echo $xml->getName() . "
"; $cou = 1; foreach($xml->children() as $child) { echo $child->getName(); if($child->getName() == "string-array"){ foreach ($child as $key2 => $value2) { echo "
"; } }else{ if (strstr($child,"color") or strstr($child,"%1") or strstr($child,"%s") or strstr($child,"\n") ) { echo "有 特殊字符 "; $cou++; } echo "
"; } }

回复内容:

我现在的代码 找不到 /n 字符

PHP中关于strstr函数查找 /n特殊字符?

PHP中关于strstr函数查找 /n特殊字符?

请问如何找到嗯?


扔上来的代码

$xml = simplexml_load_file("ZH-CNstrings.xml");

// echo $xml->getName() . "
"; $cou = 1; foreach($xml->children() as $child) { echo $child->getName(); if($child->getName() == "string-array"){ foreach ($child as $key2 => $value2) { echo "
"; } }else{ if (strstr($child,"color") or strstr($child,"%1") or strstr($child,"%s") or strstr($child,"\n") ) { echo "有 特殊字符 "; $cou++; } echo "
"; } }

试试 \n

相关标签: php