note 89581 deleted from function.ctype-alpha by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 08:04:10 +0000 |
| Subject: | note 89581 deleted from function.ctype-alpha by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196789@lists.php.net to get a copy of this message | ||
Note Submitter: jerome at yazo dot net
----
worth noticing? It seems that the ctype_alpha family of functions won't handle UTF-8 string
(php 5.2.6)
<?php
$texte = 'jérôme';
setLocale(LC_CTYPE, 'FR_fr');
echo 'Pure ascii ? ', (ctype_alpha($texte) ) ? 'yes' : 'no';
echo '<br />';
$texte = iconv( "UTF-8", "ISO-8859-1", $texte) ;
echo 'Letters only ? ' , (ctype_alpha($texte) ) ? 'yes' : 'no';
?>
ouputs :
Pure ascii ? no
Letters only ? yes