first i'm sorry for bad title, my english is not good enough and my little problem is not plain (for me).
Anyway, i have a rudimental script that counts how many times appears a list of words in a string.
$orto1 = substr_count($text," fingger ");
$orto2 = substr_count($text," apears ");
$orto3 = substr_count($text,"ghiven");
$ortog = $orto1 + $orto2 + $orto3;
Now, it's very uncomfortable whenever i've to add a new word, so, i'd like put all words in a array.
So, i've tried with substr_count as well as several examples found here, unsuccessfully.
I'd like to manage to create something like that:
$array = array(" fingger ", " apears ", "ghiven", "suporting");
$total = substr_count($array, $mytext);
echo $total;
Important is case insensitive and "wildcard" matching.
Is it possible or there is another best way?
Thank you at all! Riccardo