In PHP versions before 4.4.1, ctype functions have a bug handling very large integers.
http://bugs.php.net/bug.php?id=34645
See Crimson's comment under ctype_digit, or this test code from the bug:
<?php
$id = 394829384;
var_dump($id);
ctype_digit($id);
var_dump($id);
?>
Expected result:
----------------
int(394829384)
int(394829384)
Actual result:
--------------
int(394829384)
NULL
The fix is to cast it as a string:
<?php
ctype_digit((string)$id);
?>
... or use a current version of PHP!
Funções da Ctype
Índice
- ctype_alnum — Verifica se os caracteres são alfanuméricos
- ctype_alpha — Verifica se os caracteres são alfabéticos
- ctype_cntrl — Verifica se os caracteres são de controle
- ctype_digit — Verifica se os caracteres são numéricos
- ctype_graph — Verifica se os caracteres são imprimíveis exceto espaço
- ctype_lower — Verifica se os caracteres estão minúsculos
- ctype_print — Verifica se os caracteres são imprimíveis
- ctype_punct — Verifica se é um caractere imprimível que não é whitespace ou alfanumério
- ctype_space — Verifica se os caracteres são whitespace
- ctype_upper — Verifica se os caracteres são maiúsculos
- ctype_xdigit — Verifica se os caracteres representam um dígito hexadecimal
User Contributed Notes
Funções da Ctype
Funções da Ctype
14-Oct-2006 11:44
avarab at gmail dot com
03-Jan-2006 06:58
03-Jan-2006 06:58
In case the ctype_*() functions aren't compiled in your PHP and you can't recompile for some reason (e.g. shared host) you can use the compatability functions from the MediaWiki project which use preg_* as a replacement[1], removing lines 2 and 3 in the source should make them suitable for usage elsewhere.
Shameless self-advertisement, but hey, we find them useful;)
1. A tinyurl because the submission script complained about long lines: http://tinyurl.com/7hz4l
1. The real url split up:
http://cvs.sourceforge.net/viewcvs.py/*checkout*/
wikipedia/phase3/includes/compatability/ctype.php

Constantes pré-definidas