int strcasecmp ( string $str1 , string $str2 ) This means thatstrcasecmp()function accepts two string (comma separated) as input to compare and returns an int (integer). See the following table to understand the above function definition in an easy way: ...
示例#1 strncasecmp() 示例 <?php$var1 = 'Hello John';$var2 = 'hello Doe';if (strncasecmp($var1, $var2, 5) === 0) { echo 'First 5 characters of $var1 and $var2 are equals in a case-insensitive string comparison';}?>参见...
strtoupper — Make a string uppercase strtr — Translate certain characters substr_compare — Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length characters substr_count — Count the number of substring occurrences substr_replace — Replace text within a porti...
Find the first occurrence of a string 查找字符串的首次出现 strtok() Tokenize string 标记分割字符串 strtolower() Make a string lowercase 将字符串转化为小写 strtoupper() Make a string uppercase 将字符串转化为大写 strtr() Translate characters or replace substrings 转换指定字符 substr_compare() Binar...
substr_replace(string $string, string $replacement, int $start, ?int $length): 这个用法是将字符串$string中从$start位置开始的$length个字符替换为$replacement字符串。 substr_compare(string $string1, string $string2, int $start, ?int $length, bool $case_insensitive): 这个用法是比较两个字符串$...
strstr — Find first occurrence of a string strtok — Tokenize string strtolower — Make a string lowercase strtoupper — Make a string uppercase strtr — Translate certain characters substr_compare — Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length char...
>0 - if string1 is greater than string2 PHP Version:4+ More Examples Example Compare two strings (case-insensitive = HELLO and hELLo will output the same): <?php echostrcasecmp("Hello","HELLO"); echo""; echostrcasecmp("Hello","hELLo"); ?> Try...
strtok()Splits a string into smaller strings strtolower()Converts a string to lowercase letters strtoupper()Converts a string to uppercase letters strtr()Translates certain characters in a string substr()Returns a part of a string substr_compare()Compares two strings from a specified start positi...
strstr — Find first occurrence of a string strtok — Tokenize string strtolower — Make a string lowercase strtoupper — Make a string uppercase strtr — Translate certain characters substr_compare — Binary safe optionally case insensitive comparison of 2 strings from an offset, up to length char...
Case-Insensitive String Operations use Case-Folding ¶ Case-insensitive string operations now use case-folding instead of case- mapping during comparisons. This means that more characters will be considered (case insensitively) equal now.