function ValidTrueName($TrueName)
{
$TrueName = trim($TrueName);
$Length = mb_strlen($TrueName, ‘gbk’);
if($Length>1 && $Length<6 && preg_match(“/^[\x7f-\xff]+$/”, $TrueName))
{
$FirstName = mb_substr($TrueName, 0, 1, ‘gbk’);
$NameArray = @array_map(‘trim’, file(‘SysData/FirstName.php’));
if(@in_array($FirstName, $NameArray))
return true;
else
return false;
}
else return false;
}
转载请注明:苏demo的别样人生 » php验证用户名是否是真实姓名