SEO Forums


Chess, Go & Poker Server









                                          
User   Password   remember   (register)  ?

bin2hex()



La fonction PHP bin2hex() a pour but de convertir des données binaires, par exemple une chaine de caractères, en leur représentation hexadécimale.

Cet article donne une comparaison de la durée de l'exécution de cette fonction avec d'autres fonctions PHP basiques.

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

Description :  string bin2hex ( string $str )


$str étant la chaine à convertir.

Quelques exemples de l'utilisation de cette fonction :

print bin2hex('1001');
// Affiche : 31303031
print bin2hex(1001);
// Affiche : 31303031


Considérez la ligne de code suivante :

$chaine = bin2hex('1001');

La durée de son exécution est d'environ 0.00159 milli-seconde, soit environ 9 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.bin2hex.php

Voir également la fonction hex2bin()



* addcslashes()
* addslashes()
* chop()
* chr()
* chunk_split()
* 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 :