PHP Ds/set count() 함수

| | | | | | | | |
구문:
int public DsSet::count()
매개변수:이 함수는 매개변수를 사용하지 않습니다.반환 value:이 함수는 Set 인스턴스에 있는 값의 수를 반환합니다. 다음 프로그램은 Ds 함수 / Set::count() 를 보여줍니다.프로그램 1: <코드><코드>
// 새로운 세트 선언$set = new DsSet([10, 15, 21]);
// 세트 요소 표시var_dump( $set );
// 항목 수 표시
// 세트에 존재echo "Count is:" ; print_r ( $set -> count ());
?> 종료:
객체(DsSet) # 1(3) {[0] = > int(10) [1] = > int(15) [2] = > int (21)} 개수: 3
프로그램 2:
// 새로운 세트 선언$set = new DsSet ( [ "괴짜" , "for" , "Keegs" ]);
// 세트 요소 표시var_dump ( $set );
// 항목 수 표시
// 세트에 존재echo "Count is:" ; print_r ( $set -> count ());
?>
Exit:
object (DsSet ) # 1 (3) {[0] = > string (5) "Geeks" [1] = > string (3) " " [2] = > string (5) "Keegs"} 개수: 3
링크: http://php.net/manual/en/ds-set. count.php