compter un élément qui se trouve dans un tableau d'un autre
Bonjour,
Comment je peux compter mes tableaux ( array )qui se trouvent dans un autre (array) :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
| Array
(
[0] => Array
(
[nom] => Toto
[prenom] => Array
(
)
[adresse] => Array
(
[0] => Array
(
[N] => 175
)
[1] => Array
(
[N] => bis
)
)
))
[1] => Array
(
[nom] => Tata
[prenom] => Array
(
)
[adresse] => Array
(
[0] => Array
(
[N] => 25
)
[1] => Array
(
[N] => ter
)
)
)
[2] => Array
(
[nom] => Mimi
[prenom] => Array
(
)
[adresse] => Array
(
[0] => Array
(
[N] => 175
)
[1] => Array
(
[N] => bis
)
)
)
) |
Ce que je pense, mais ce n'est pas bon :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
|
$data = array(
array ('nom' => 'Toto','prenom' => array (),'adresse' => array (array ('N' => '175'), array ('N' => 'bis5') )),
array ('nom' => 'Tata','prenom' => array (),'adresse' => array (array ('N' => '25'), array ('N' => 'ter') )),
array ('nom' => 'Mimi','prenom' => array (),'adresse' => array (array ('N' => '175'), array ('N' => 'bis5') ))
);
print_r($data);
//$combien = count($data['']['nom']);
$combien = count($data['nom']);
echo '<br><br>' . $combien ; |
Comment peux je descendre à deuxième nouveau pour les compter ?
Merci