(PHP 4 >= 4.0.4, PHP 5, PHP 7)
ctype_alnum — 锟斤拷锟斤拷母锟斤拷锟斤拷锟斤拷锟街凤拷锟斤拷锟�
text
锟斤拷锟斤拷锟街凤拷锟斤拷锟斤拷
锟斤拷锟�text
锟斤拷锟斤拷锟叫碉拷锟街凤拷全锟斤拷锟斤拷锟斤拷母锟斤拷(锟斤拷锟斤拷)锟斤拷锟街o拷锟斤拷锟斤拷 TRUE
锟斤拷锟津返伙拷FALSE
Example #1 A ctype_alnum() 示锟斤拷 (使锟斤拷默锟较碉拷锟斤拷锟斤拷锟斤拷锟斤拷)
<?php
$strings = array('AbCd1zyZ9', 'foo!#$bar');
foreach ($strings as $testcase) {
if (ctype_alnum($testcase)) {
echo "The string $testcase consists of all letters or digits.\n";
} else {
echo "The string $testcase does not consist of all letters or digits.\n";
}
}
?>
锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�
The string AbCd1zyZ9 consists of all letters or digits. The string foo!#$bar does not consist of all letters or digits.
Note:
锟斤拷锟斤拷锟斤拷锟揭伙拷锟� -128 锟斤拷 255 之锟斤拷(锟斤拷)锟斤拷锟斤拷锟斤拷, 锟斤拷锟结被锟斤拷锟斤拷为锟斤拷值锟斤拷应锟斤拷ASCII锟街凤拷 (锟斤拷值锟斤拷锟斤拷锟斤拷 256 锟斤拷支锟斤拷锟斤拷展ASCII锟街凤拷). 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟结被锟斤拷锟斤拷为锟斤拷值锟斤拷应锟斤拷十锟斤拷锟斤拷锟街凤拷锟斤拷.