Google

NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.7">

strspn

(PHP 3>= 3.0.3, PHP 4 )

strspn --  マスクに一致する最初のセグメントの長さを返す

説明

int strspn ( string str1, string str2)

str1の中で全て str2の中の文字からなる最初のセグメントの 長さを返します。

$var = strspn ("42 is the answer, what is the question ...", "1234567890");

このコードは、$varに2を代入します。これは、 "1234567890"からの文字を含む最長の部分が "42" であるためです。

strcspn() も参照下さい。