strcspn(3) php man page | unix.com

Man Page: strcspn

Operating Environment: php

Section: 3

STRCSPN(3)								 1								STRCSPN(3)

strcspn - Find length of initial segment not matching mask

SYNOPSIS
int strcspn (string $str1, string $str2, [int $start], [int $length])
DESCRIPTION
Returns the length of the initial segment of $str1 which does not contain any of the characters in $str2.
PARAMETERS
o $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 VALUES
Returns the length of the segment as an integer.
EXAMPLES
Example #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)
NOTES
Note This function is binary-safe.
SEE ALSO
strspn(3). PHP Documentation Group STRCSPN(3)
Related Man Pages
strspn(3) - redhat
strspn(3) - suse
strcspn(3p) - suse
strcspn(3) - osf1
strspn(3) - osf1
Similar Topics in the Unix Linux Community
string manipulation
Convert case on specified position of flat file
Find and replace permanently
Script to remove duplicates
Find the length of each line in the file