Why are extra special characters in PHP output? My intention is to only output y, but I don't know why there will always be an extra [] & nbsp ;. & Nbsp; check userName $ userName & nbsp; $ _ POST [username]; if (! Preg_match (^ [0-9a-why are extra special characters in PHP output?
My intention is to only output y, but I don't know why there will always be an extra [].
// Verify the user name
$ UserName = $ _ POST ['username'];
If (! Preg_match ('/^ [0-9a-zA-Z] {3, 16} $/', $ userName )){
Die ();
}
// Determine whether the user already exists
Require ('./../inc/pdo_conn.php ');
$ HPdoPre = $ hPdo-> prepare ("SELECT user_name FROM user WHERE user_name =: username ");
$ HPdoPre-> bindParam (': username', $ username, PDO: PARAM_STR );
$ HPdoPre-> execute ();
$ Result = $ hPdoPre-> fetchAll ();
// If it is null, you can register
If (empty ($ result )){
Echo 'y ';
} Else {
Echo 'n ';
}
It's really anxious. after testing, we found that only y is output normally after the require part is removed, but there is no output in this part, and there is no problem elsewhere. Really helpless, for help
------ Solution --------------------
Check whether the pdo_conn.php file contains the BOM.
------ Solution --------------------
BOM word patch
------ Solution --------------------
Do not use notepad to write a program. use editplus to save it as one and remove BOM.