downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

grapheme_strpos> <grapheme_stristr
[edit] Last updated: Wed, 22 May 2013

view this page in

grapheme_strlen

(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)

grapheme_strlenLit la taille d'une chaîne en nombre de graphème

Description

Style procédural

int grapheme_strlen ( string $input )

Lit la taille d'une chaîne en nombre de graphème (et non pas en octets ou caractères).

Liste de paramètres

input

La chaîne à mesurer. Elle doit être une chaîne UTF-8 valide.

Valeurs de retour

La taille de la chaîne, et 0 si la chaîne est vide.

Exemples

Exemple #1 Exemple avec grapheme_strlen()

<?php

$char_a_ring_nfd 
"a\xCC\x8A";  // 'LATIN SMALL LETTER A WITH RING ABOVE' (U+00E5) forme normalisée "D"
$char_o_diaeresis_nfd "o\xCC\x88"// 'LATIN SMALL LETTER O WITH DIAERESIS' (U+00F6) forme normalisée "D"

print grapheme_strlen'abc' $char_a_ring_nfd $char_o_diaeresis_nfd $char_a_ring_nfd);

?>

L'exemple ci-dessus va afficher :

6


add a note add a note User Contributed Notes grapheme_strlen - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites