ctype_digit()Yoast 1.0

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() Yoast 19.7.1

function ctype_digit( $text ) {
	$return = false;
	if ( ( is_string( $text ) && $text !== '' ) && preg_match( '`^\d+$`', $text ) === 1 ) {
		$return = true;
	}

	return $return;
}