ctype_digit

The Yoast SEO ctype digit function.

Description

ctype_digit( (string) $string ); 

Parameters (1)

0. $string (string)
String input to validate.

Usage

  1. if ( !function_exists( 'ctype_digit' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'yoast-seo/inc/wpseo-functions.php'; 
  3.  
  4. // String input to validate. 
  5. $string = ''; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = ctype_digit($string); 
  9.  

Defined (1)

The function is defined in the following location(s).

/inc/wpseo-functions.php  
  1. function ctype_digit( $string ) { 
  2. $return = false; 
  3. if ( ( is_string( $string ) && $string !== '' ) && preg_match( '`^\d+$`', $string ) === 1 ) { 
  4. $return = true; 
  5.  
  6. return $return;