array_rand <<< |
array_reduce | array_reverse >>> |
7.2 Tableaux 7 Index des fonctions Manuel PHP . Introduction . Pré-requis . Installation . Configuration à l'exécution . Types de ressources . Constantes prédefinies . Voir aussi . array_change_key_case . array_chunk . array_combine . array_count_values . array_diff_assoc . array_diff . array_fill . array_filter . array_flip . array_intersect_assoc . array_intersect . array_key_exists . array_keys . array_map . array_merge_recursive . array_merge . array_multisort . array_pad . array_pop . array_push . array_rand ->array_reduce . array_reverse . array_search . array_shift . array_slice . array_splice . array_sum . array_unique . array_unshift . array_values . array_walk . array . arsort . asort . compact . count . current . each . end . extract . in_array . key . krsort . ksort . list . natcasesort . natsort . next . pos . prev . range . reset . rsort . shuffle . sizeof . sort . uasort . uksort . usort |
7.2.29 array_reduce()Réduit itérativement un tableau[ Exemples avec array_reduce ] PHP 4 >= 4.0.5 mixed array_reduce ( array input , callback function , int initial )array_reduce applique itérativement la fonction callback aux éléments du tableau input , de manière à réduire le tableau à une valeur simple. Si l'argument optionnel intial est disponible, il sera utilisé pour initialiser le processus, ou bien comme valeur finale si le tableau est vide.
Dans cet exemple, $b contiendra 15 , $c contiendra 1200 (= 1*2*3*4*5*10), et $d contiendra 1 . Voir aussi array_filter , array_map , array_unique et array_count_values . |
<< | array_reduce | >> |
array_rand | Tableaux | array_reverse |