Why is the PHP output extra special characters?
My intention is to only output y, but I do not know why there is always an extra [].
Verify User Name
$userName = $_post[' userName ');
if (!preg_match ('/^[0-9a-za-z]{3,16}$/', $userName)) {
Die ();
}
Determine if 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::P aram_str);
$hPdoPre->execute ();
$result = $hPdoPre->fetchall ();
If it is empty, you can register
if (empty ($result)) {
echo ' Y ';
}else{
echo ' n ';
}
Really let people catch the urgency Ah, after testing found require this part of normal only output Y, but this part of the inside there is no output ah, and in other places there is no problem ah. Really helpless ah, help AH
------Solution--------------------
Check if the pdo_conn.php file contains a BOM
------Solution--------------------
BOM Word Patch
------Solution--------------------
Do not use Notepad to write programs, save as a editplus to remove the BOM