Query: strcspn
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
STRCSPN(3) 1 STRCSPN(3) strcspn - Find length of initial segment not matching maskSYNOPSISint strcspn (string $str1, string $str2, [int $start], [int $length])DESCRIPTIONReturns the length of the initial segment of $str1 which does not contain any of the characters in $str2.PARAMETERSo $str1 - The first string. o $str2 - The second string. o $start - The start position of the string to examine. o $length - The length of the string to examine.RETURN VALUESReturns the length of the segment as an integer.EXAMPLESExample #1 strcspn(3) example <?php $a = strcspn('abcd', 'apple'); $b = strcspn('abcd', 'banana'); $c = strcspn('hello', 'l'); $d = strcspn('hello', 'world'); var_dump($a); var_dump($b); var_dump($c); var_dump($d); ?> The above example will output: int(0) int(0) int(2) int(2)NOTESNote This function is binary-safe.SEE ALSOstrspn(3). PHP Documentation Group STRCSPN(3)
Related Man Pages |
---|
strcspn(3) - linux |
strcspn(3) - suse |
strcspn(3p) - suse |
strcspn(3) - osx |
strcspn(3) - php |