SEO Forums


Chess, Go & Poker Server









                                          
User   Password   remember   (register)  ?

ereg()



La fonction PHP ereg() effectue une recherche en tenant compte de la casse, en suivant une expression rationnelle standard appelée masque de recherche.

Cet article donnera une comparaison de la durée de l'exécution de cette fonction par rapport à d'autres fonctions PHP.

Cette fonction s'emploie comme suit en PHP 4 et PHP 5 (il est à noter que cette fonction est obsolète depuis PHP 5.3 et a disparu depuis PHP 6).

Description :  int ereg ( string $pattern , string $string [, array &$regs ] )


$string étant la chaine dans laquelle on va effectuer la recherche avec l'expression régulière $pattern.

Un exemple de l'utilisation de cette fonction :

$entier = ereg('e',"C'est un exemple");


Considérez la ligne de code suivante :

$entier = ereg('e',"C'est un exemple");

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

Voir également les fonctions eregi(), ereg_replace(), eregi_replace() et preg_match()



* addcslashes()
* addslashes()
* bin2hex()
* chop()
* chr()
* chunk_split()
* count_chars()
* crypt()
* 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 to your contacts!   In your blog, anywhere...
(works with Facebook, Twitter, MSN, Yahoo, MySpace, Hi5, Bebo, Youtube...)






Tip of the day :

Promote your website & protect your Uptobox, Mega or Mediafire links !

Here is the simplest 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 :