Gen. partnerAlgotech

PHP function strspn()

Finds the length of the first segment of a string consisting

|
September 11, 2019

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

Loading comments...

Stay in the loop

Subscribe to our newsletter and get the latest cybersecurity news delivered straight to your inbox.

Your data is safe. You can unsubscribe from the newsletter at any time.