PHP » PYTHON |
login |
register |
about
|
PYTHON ctype_digit
is this article helpful?
|
Python replacement for PHP's ctype_digit
[
edit
| history
]
text.isdigit() ctype_digit(PHP 4 >= 4.0.4, PHP 5) ctype_digit — Check for numeric character(s) Description
bool ctype_digit
( string $text
)
Checks if all of the characters in the provided string, text , are numerical. Parameters
Return ValuesReturns TRUE if every character in the string text is a decimal digit, FALSE otherwise. Changelog
Examples
Example #1 A ctype_digit() example
<?php The above example will output: The string 1820.20 does not consist of all digits. The string 10002 consists of all digits. The string wsl!12 does not consist of all digits.
Example #2 A ctype_digit() example comparing strings with integers
<?php
Notes
See Also
|
more
Recently updated
more
Most requested
more
Last requests
|