Home  >  Article  >  Backend Development  >  空白字符转换有关问题

空白字符转换有关问题

WBOY
WBOYOriginal
2016-06-13 13:52:17959browse

空白字符转换问题

echo $_POST['aaa'].'
';
function htmlpost($x){
$x1=array(' ');
$x2=array(" ");
$x=str_replace($x1,$x2,$x);
return $x;
}
echo $_POST['aaa']=htmlpost($_POST['aaa']);
?>


 
 


在输入框输入连续两个以上空白字符
按第一次提交没有问题,空白字符可以转换 ,但是按第二次提交,空白的字符没有转换为 
请问什么原因?

------解决方案--------------------
utf8
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