note 89581 added to ref.ctype
| From: | jerome at yazo dot net | Date: | Sun, 15 Mar 2009 04:18:54 +0000 |
| Subject: | note 89581 added to ref.ctype | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-151955@lists.php.net to get a copy of this message | ||
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
----
Server IP: 216.235.13.26
Probable Submitter: 216.252.76.171
----
Manual Page -- http://www.php.net/manual/en/ref.ctype.php
Edit -- https://master.php.net/note/edit/89581
Del: integrated -- https://master.php.net/note/delete/89581/integrated
Del: useless -- https://master.php.net/note/delete/89581/useless
Del: bad code -- https://master.php.net/note/delete/89581/bad+code
Del: spam -- https://master.php.net/note/delete/89581/spam
Del: non-english -- https://master.php.net/note/delete/89581/non-english
Del: in docs -- https://master.php.net/note/delete/89581/in+docs
Del: other reasons-- https://master.php.net/note/delete/89581
Reject -- https://master.php.net/note/reject/89581
Search -- https://master.php.net/manage/user-notes.php