Lines Matching refs:array
2 Test array_unshift() function : usage variations - two dimensional arrays for 'array' argument
5 /* Prototype : int array_unshift(array $array, mixed $var [, mixed ...])
6 * Description: Pushes elements onto the beginning of the array
7 * Source code: ext/standard/array.c
12 * arrays and also sub-arrays within the two-dimensional array for $array argument.
16 echo "*** Testing array_unshift() : two dimensional arrays for \$array argument ***\n";
21 // two-dimensional array to be passed to $array argument
22 $two_dimensional_array = array(
24 // associative array
25 array('color' => 'red', 'item' => 'pen', 'place' => 'LA'),
27 // numeric array
28 array(1, 2, 3, 4, 5),
31 array('a' => 'green', 'red', 'brown', 33, 88, 'orange', 'item' => 'ball')
34 /* Passing the entire $two_dimensional_array to $array */
37 // returns element count in the resulting array after arguments are pushed to
38 // beginning of the given array
40 var_dump( array_unshift($temp_array, $var) ); // whole 2-d array
42 // dumps the resulting array
46 // returns element count in the resulting array after arguments are pushed to
47 // beginning of the given array
49 var_dump( array_unshift($temp_array, $var, "hello", 'world') ); // whole 2-d array
51 // dumps the resulting array
54 /* Passing the sub-array within the $two_dimensional_array to $array argument */
57 // returns element count in the resulting array after arguments are pushed to
58 // beginning of the given array
60 var_dump( array_unshift($temp_array, $var) ); // sub array
62 // dumps the resulting array
66 // returns element count in the resulting array after arguments are pushed to
67 // beginning of the given array
69 var_dump( array_unshift($temp_array, $var, "hello", 'world') ); // sub array
71 // dumps the resulting array
77 *** Testing array_unshift() : two dimensional arrays for $array argument ***
79 array(4) {
83 array(3) {
92 array(5) {
105 array(7) {
123 array(6) {
131 array(3) {
140 array(5) {
153 array(7) {
171 array(4) {
182 array(6) {