The problem is that if stripos returns a non-zero value, it will be converted to true, but if it returns a zero, it will be converted to false. Since 'a' is the first character, stripos will thus return 0, and so the comparison with true evaluates to false, thus "Not found" is printed.
The solution is to compare, using operator=== (or !==), with false, since stripos returns false if the search string is not found:
<?php
$search="a";
$total = "aNbh jK ";
if (stripos($total, $search, 0) !== false) {
echo "found";
} else {
echo "Not found";
}
By the way, please do not cross post.