您可以使用以下命令测试您的字符串(让
$str)
preg_match:
if(preg_match("/^[a-zA-Z0-9]+$/", $str) == 1) { // string only contain the a to z , A to Z, 0 to 9}如果需要更多符号,可以在之前添加它们
]

您可以使用以下命令测试您的字符串(让
$str)
preg_match:
if(preg_match("/^[a-zA-Z0-9]+$/", $str) == 1) { // string only contain the a to z , A to Z, 0 to 9}如果需要更多符号,可以在之前添加它们
]