strcspn

strcspn

(PHP 4, PHP 5, PHP 7)

strcspnFind length of initial segment not matching mask

Description

int strcspn ( string $subject , string $mask [, int $start [, int $length ]] )

Returns the length of the initial segment of subject which does not contain any of the characters in mask.

If start and length are omitted, then all of subject will be examined. If they are included, then the effect will be the same as calling strc