PHP function strspn()

Availability in PHP 4.0

Finds the length of the first segment of a string consisting

Parameters

Parameter Data type Default value Note
$subject string not The string to examine.
$mask string not The list of allowable characters to include in counted segments.
$start int null, The position in subject to start searching.
$length int null The length of the segment from subject to examine.

Return values

int

the length of the initial segment of str1 which consists entirely of characters in str2.

Other resources

Official strspn documentation

Newsletter

Nejlepsi tipy a triky o PHP do Vaseho e-mailu. Clanky a novinky nejen ze sveta PHP a programovani.