字串函式庫

strspn

(PHP3 >= 3.0.3 , PHP4)

strspn ---  找出比對到的最初部份的長度

語法 : int strspn (string str1, string str2)

說明 : 

傳回 str1最初的部份的長度,這個部份是完全地由 str2中的字元所構成的。

Example :

<?php

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

?>

傳回的結果將會是 2

參考 : strcspn( )


上一頁 首頁 下一頁