You are not logged in.
Login
or
Register
.
JsPHP: a JavaScript library providing the PHP API
Home
Register
Demo
Categories
Functions
Contributors
Download
Links
Comments
FAQ
Contact
View
Edit
Benchmark
Revisions
Developers
Dependencies
Talk
Links
ctype_digit:
Edit: ctype_digit
Function:
ctype_digit
View ctype_digit
Edit ctype_digit
Edit code
Edit tests
Edit benchmark
View latest code
Edit latest code
Benchmark ctype_digit
Comment on ctype_digit
Comment on the latest code
View revisions
View versions
View contributors
View dependencies
View comments
View links
Download production code
Download development code
View the PHP docs
View phpjs.org
View phpjs.org raw code
Description:
Checks for numeric character(s).
Edit function
Code
:
function ctype_digit (text) { // http://jsphp.co/jsphp/fn/view/ctype_digit // + original by: Brett Zamir (http://brett-zamir.me) // - depends on: setlocale // * example 1: ctype_digit('150'); // * returns 1: true if (typeof text !== 'string') { return false; } // BEGIN REDUNDANT this.setlocale('LC_ALL', 0); // ensure setup of localization variables takes place // END REDUNDANT return text.search(this.php_js.locales[this.php_js.localeCategories.LC_CTYPE].LC_CTYPE.dg) !== -1; }
You have to be logged in to edit functions.
[
top
]
Comments
There are no comments yet, be the first!
Please
Login
or
Register
to post comments.