Home > Backend Development > PHP Tutorial > 为啥PHP输出多出了特殊字符

为啥PHP输出多出了特殊字符

WBOY
Release: 2016-06-13 12:06:15
Original
1226 people have browsed it

为什么PHP输出多出了特殊字符?
我的本意是只输出y,但是不知道为什么前面总会多出了个[] 如图所示

	<br />        //校验用户名<br />	$userName = $_POST['username'];<br />	if(!preg_match('/^[0-9a-zA-Z]{3,16}$/', $userName)){<br />		die();<br />	}<br />	//判断用户是否已经存在<br />	require('./../inc/pdo_conn.php');<br />	$hPdoPre = $hPdo->prepare("SELECT user_name FROM user WHERE user_name=:username");<br />	$hPdoPre->bindParam(':username', $userName, PDO::PARAM_STR);<br />	$hPdoPre->execute();<br />	$result = $hPdoPre->fetchAll();<br /><br />	//如果为空则可以注册<br />	if(empty($result)){<br />		echo 'y';<br />	}else{<br />		echo 'n';<br />	}
Copy after login

        真让人捉急啊,经过测试发现require这部分去掉之后正常只输出y,但是这部分里面并没有任何的输出啊,而且在其它地方是没有问题的啊。真的无奈啊,求救啊
------解决方案--------------------
检查下pdo_conn.php文件是不是包含了BOM
------解决方案--------------------
BOM 字数补丁
------解决方案--------------------
不要用记事本写程序,用editplus另存为一下去掉BOM

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template