• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
Yoast SEO a2z

Yoast SEO a2z

WordPress SEO a2z

  • Home
  • Plugins
  • Blocks
  • Shortcodes
  • APIs
  • Classes
  • Files
  • Hooks
  • Sitemap
  • Blog
Home / APIs / ctype_digit() – Emulate PHP native ctype_digit() function for when the ctype extension would be disabled *sigh*.

You appear to be a bot. Output may be restricted

Description

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.

Usage

$bool = ctype_digit( $string );

Parameters

$string
( string ) required – String input to validate.

Returns

bool

Source

File name: wordpress-seo/inc/wpseo-functions.php
Lines:

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

    return $return;
  }
 

 View on GitHub View on Trac

Published: 27th November 2019 | Last updated: 27th November 2019

Primary Sidebar

Information

Function name: ctype_digit
Plugin ref: Yoast SEO
Version: 15.4
Sourcefile: inc/wpseo-functions.php
File ref: inc/wpseo-functions.php
Deprecated?: No
API Letters: C,D

Footer

Yoast SEO a2z
Yoast SEO a2z
WordPress SEO a2z
WordPress 5.6
WordPress a2z
WordPress core a2z
Genesis Theme Framework a2z
Jetpack a2z
WordPress develop tests
Easy Digital Downloads a2z
WooCommerce a2z
Yoast SEO a2z
WordPress Blocks

Site:  wordpress-seo.wp-a2z.org
© Copyright Yoast SEO a2z 2017-2021. All rights reserved.


Website designed and developed by Herb Miller
Proudly powered by WordPress and oik plugins

  • Home
  • Blog
  • Sitemap
  • Sites