当我使用strpos()
时,它是区分大小写的。为什么?这不应该是吗?
$file_check_result = "%PDF-1.6 %âãÏÓ";
$test = strpos($file_check_result, "pdf");
echo $test;
输出;但是如果我把pdf
换成PDF
在strpos
中它显示了位置。为什么?
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)