La question est un peu vague, donc je choisi un scénario simple/solution ;-)
$keywords = array('PHP', 'introduction', 'call', 'supercalifragilistic');
$text = file_get_contents('http://www.php.net/archive/2009.php'); // including all the html markup, only an example
$words = array_count_values(str_word_count($text, 2));
$result = array_intersect_key($words, array_flip($keywords));
var_dump($result);
impressions
array(2) {
["PHP"]=>
int(157)
["call"]=>
int(7)
}
Ce qui signifie: le mot-clé PHP
a été trouvé 157 fois, call
7 fois et supercalifragilistic
zéro fois.
Ne hésitez pas à préciser ce que vous essayez et que vous avez besoin ....
hum ok, j'ai trouvé: http://stackoverflow.com/questions/539816/steps-in-implementing -hashtable-in-php-and-mysql/539840 # 539840 – Roch