PHP 函数 ctype_digit()
PHP 函数 ctype_digit()
<?php
$strings = array('122.50', '1004', 'foo!#$bar');
foreach ($strings as $test) {
if (ctype_digit($test)) {
echo "$test consists of all digits. \n";
}else {
echo "$test does not have all digits. \n";
}
}
?>