The strstr function finds the first occurance of 'what your looking for', but is case sensitive (use stristr() for insensitive). You can also use preg_match() for a more powerful search.
Here's what you should do:
// stristr method
if(stristr($file,"index.php")) {
print "hello";
}
// preg_match method
if (preg_match ("/index.php/i", $file))
{
print "hello";
}
hope this helps!