ctype_digit()
Emulate PHP native ctype_digit() function for when the ctype extension would be disabled sigh. Only emulates the behaviour for when the input is a string, does not handle integer input as ascii value.
Хуков нет.
Возвращает
true|false.
Использование
ctype_digit( $text );
- $text(строка) (обязательный)
- String input to validate.
Код ctype_digit() ctype digit Yoast 27.4
function ctype_digit( $text ) {
$return = false;
if ( ( is_string( $text ) && $text !== '' ) && preg_match( '`^\d+$`', $text ) === 1 ) {
$return = true;
}
return $return;
}