hi,
Die funktion soll mir zählen, wie oft ein bestimmter string ($string) in einem array, einer datei ($file) vorkommt. jedoch gibt mir die funktion immer den wert 0 aus, und das, obwohl filesize != 0 ist.
$file_array = file($file);
hast du berücksichtigt, dass file() beim einlesen die zeilenumbrüche am ende jeder zeile bestehen lässt?
dann würde in_array "blah" natürlich nicht finden, wenn in wirklichkeit "blah\n" im array steht ...
gruß,
wahsaga
--
"Look, that's why there's rules, understand? So that you _think_ before you break 'em."
"Look, that's why there's rules, understand? So that you _think_ before you break 'em."