SEO Forums


Chess, Go & Poker Server









                                          
User   Password   remember   (register)  ?

chunk_split()



La fonction PHP chunk_split() a pour but de scinder une chaine de caractères.

Cet article se donne pour but de comparer la durée de l'exécution de cette fonction afin d'optimiser vos programmes PHP.

Cette fonction s'emploie comme suit en PHP 4 et PHP 5.

Description :

string chunk_split ( string $body [, int $chunklen = 76 [, string $end = "rn" ]] )



$body étant la chaine à scinder, $chunklen la taille de la portion et $end le caractère de fin de la séquence.

Un exemple de l'utilisation de cette fonction :

echo chunk_split(base64_encode("c'est un exemple"));
// Sert à formater des données en suivant la norme RFC 2045


Considérez la ligne de code suivante :

$chaine = chunk_split("c'est un exemple");

La durée de son exécution est d'environ 0.00195 milli-seconde, soit 11.2 fois plus longue que celle de la ligne (( $a = 1; )) avec Easy PHP 2.0 - Apache 2.2.3, PHP 5.2 et MySQL 5.0.27 - sur un ordinateur portable équipé d'un processeur Intel Core 2 Duo T5800 cadencé à 2.0 GHz.

Pour plus de détails et des exemples supplémentaires, vous pouvez consulter le manuel PHP.net :

http://www.php.net/manual/fr/function.chunk_split.php

Voir également les fonctions split(), str_split(), explode(), wordwrap()



* addcslashes()
* addslashes()
* bin2hex()
* chop()
* chr()
* count_chars()
* crypt()
* ereg()
* eregi()
* eregi_replace()
* ereg_replace()
* explode()
* htmlentities()
* htmlspecialchars()
* html_entity_decode()
* implode()
* join()
* ltrim()
* md5()
* md5_file()
* nl2br()
* rtrim()
* sha1()
* sha1_file()
* split()



Last modification : March 23, 2010










 
 


Make your profile in the social network :

- Create groups, pages and events.
- Promote your website (free backlink).
- Keep in touch with your friends.
- Discover what your friends think about you.
- And many more features soon...

 


Write upside down in your blog, anywhere!
(works with Twitter, Facebook, MySpace, Youtube, MSN, Yahoo, Bebo, Hi5...)






Tip of the day :

Protect your files on Mega, Uptobox or Mediafire, and promote your website !

You may use this free tool : Protect your links




FICGS is also a Free Internet Correspondence Games Server.

Here you can play Chess, Go & Poker Texas Holdem online for free in rated class tournaments and a unique world championship. Special events (chess 960) and tournaments with money prizes are also organized.

Free Internet Chess & Go Server


Feel free to link to this page and to FICGS chess server :