I was always clued out on how to do this with php when all of a sudden it hit me how simple this is so i thought i would share my function with everyone else, it works and it works good!
//case-insensitive string compare function
function strcompare($needle, $haystack) {
$found = 0;
$occurences = 0;
for($i=0;$i<strlen($haystack);$i++) {
if(strtolower(substr($haystack, $i, strlen($needle))) == strtolower($needle)) {
$found = 1;
$occurences++;
}
}
$r["found"] = $found;
$r["times"] = $occurences;
return $r;
}