PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

strstr> <strrpos
Last updated: Sun, 25 Nov 2007

view this page in

strspn

(PHP 4, PHP 5)

strspn — 마스크에 매칭되는 초기 세그먼트의 길이를 찾는다.

설명

int strspn ( string $str1 , string $str2 )

str2 안의 모든 문자들을 가지는 str1 의 초기 세그먼트의 길이를 반환합니다.

간단한 코드:

<?php
$var 
strspn ("42 is the answer, what is the question ...""1234567890");
?>

문자열 "42"가 "1234567890"으로 구성되는 가장 긴 세그먼트이기에, $var에 2가 들어갑니다.

참고: strcspn().



add a note add a note User Contributed Notes
strspn
B Crawford
02-Oct-2007 05:20
This function is significantly faster for checking illegal characters than the equivalent preg_match() method.

strstr> <strrpos
Last updated: Sun, 25 Nov 2007
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites