当我使用strpos()它时,它是区分大小写的。为什么?不应该是吗?
PHP v5.3.8
$file_check_result = "%PDF-1.6 %âãÏÓ";
$test = strpos($file_check_result, "pdf");
echo $test;
什么都不输出;但是,如果我更改pdf为显示位置。为什么?PDFstrpos
stripos是您正在寻找的功能。strpos区分大小写
不区分大小写的是stripos(注意i):
strpos() // Finds the position of the first occurrence (case-sensitive)
stripos() // Finds the position of the first occurrence (case-insensitive)
strrpos() // Finds the position of the last occurrence (case-sensitive)
strripos() // Finds the position of the last occurrence (case-insensitive)