Est-il possible d'obtenir tous les caractères alphabétiques (A-Z) dans un tableau en PHP donc je peut faire une boucle à travers eux et de les afficher?
Réponses
Trop de publicités?
PEZ
Points
9662
Gumbo
Points
279147
Kyle Michael Becker
Points
51
PHP a déjà fourni une fonction pour de telles applications.chr(x)
renvoie le caractère ascii avec index entier de x.
Dans certains cas, cette approche devrait s'avérer plus intuitive.
Reportez-vous http://www.asciitable.com/
$UPPERCASE_LETTERS = range(chr(65),chr(90));
$LOWERCASE_LETTERS = range(chr(97),chr(122));
$NUMBERS_ZERO_THROUGH_NINE = range(chr(48),chr(57));
$ALPHA_NUMERIC_CHARS = array_merge($UPPERCASE_LETTERS, $LOWERCASE_LETTERS, $NUMBERS_ZERO_THROUGH_NINE);