Sintassi:int public DsSet::count()
Parametri:questa funzione non accetta parametri.
Return valore:questa funzione restituisce il numero di valori ​​presenti nell`istanza Set. I seguenti programmi illustrano la funzione
Ds / Set::count() :
Programma 1:
// Dichiara un nuovo set
$set
=
nuovo
DsSet ([10, 15, 21]);
// Mostra elemento set
var_dump (
$set
);
// Visualizza il numero di articoli
// presente nel set
echo
"Il conteggio è:"
;
print_r (
$set
->
count
());
?>
Esci:oggetto (DsSet ) # 1 (3) {[0] = > int (10) [1] = > int (15) [2] = > int (21)} Il conteggio è: 3
Programma 2:
// Dichiara un nuovo set
$set
=
nuovo
DsSet ( [
"Geeks"
,
"for"
,
"Keegs"
]);
// Mostra elemento impostato
var_dump (
$set
);
// Visualizza il numero di elementi
// presente nel set
echo
"Il conteggio è:"
;
print_r (
$set
->
count
());
?>
Esci:oggetto (DsSet ) # 1 (3) {[0] = > string (5) "Geek" [1] = > string (3) "for " [2] = > string (5) "Keegs"} Il conteggio è: 3
Link: http://php.net/manual/en/ds-set. count.php