Search code examples
phpstrpos

PHP strpos() IS case sensitive for me


When I use strpos() it is case sensitive. Why? Isn't it not supposed to be?

PHP v5.3.8

$file_check_result = "%PDF-1.6 %âãÏÓ";
$test = strpos($file_check_result, "pdf");
echo $test;

Outputs nothing; if however I change pdf to PDF in strpos it shows position. Why?


Solution

  • stripos is the function that you are looking for. strpos is case sensitive

    http://php.net/manual/en/function.stripos.php