2011-11-07 5 views
-3

strpos()을 사용할 때 대소 문자를 구분합니다. 왜? 그렇지 않아야하지 않니?PHP strpos()가 나를 위해 대소 문자를 구분 함

의 PHP v5.3.8

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

출력 아무것도; 그러나 내가 바꾸면 pdfPDF에 넣고 strpos에 위치를 표시합니다. 왜?

+0

내가했고, 내가 내가 때문에 너무 피곤했다 추측이 – JohnA

답변

3

대소 문자를 구분 한 stripos되는 대소 문자를 구분 (유의 내가) :

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) 
관련 문제