Hướng dẫn php iterator to array
(PHP 5 >= 5.1.0, PHP 7, PHP 8) iterator_to_array — Copy the iterator into an array Descriptioniterator_to_array(Traversable Parametersiterator The iterator being copied. preserve_keys Whether to use the iterator element keys as index. If a key is an array or object, a warning will be generated.
Return Values An array containing the elements of the ExamplesExample #1 iterator_to_array() example
The above example will output: array(4) { ["recipe"]=> string(8) "pancakes" [0]=> string(3) "egg" [1]=> string(4) "milk" [2]=> string(5) "flour" } array(4) { [0]=> string(8) "pancakes" [1]=> string(3) "egg" [2]=> string(4) "milk" [3]=> string(5) "flour" } jerome at yazo dot net ¶ 13 years ago
= new ArrayIterator( array('k1' => 'a' , 'k2' => 'b', 'k3' => 'c', 'k4' => 'd') );
joksnet at gmail dot com ¶ 7 years ago
Harry Willis ¶ 7 years ago
wizzard351 at yahoo dot com ¶ 5 months ago
chad 0x40 herballure 0x2e com ¶ 14 years ago
enelar at develop-project dot ru ¶ 5 years ago
|