ARRAY_UNSHITF () inserts one or more cells at the beginning of the array
function
The function inserts the incoming cell at the beginning of the specified array
Note that the unit is inserted as a whole, so incoming cells will remain in the same order
All numeric key names are modified to count back from zero, and all text key names remain unchanged
Finally returns the number of new cells in the array
"Scope of Use"
PhP4, PHP5.
Use
int Array_unshift (array &array,mixed var[,mixed ...])
&array/Required/Imminent insert operation original array
var/required/About to add value
Example
[PHP]
$array =array ("Orange", "banana");
Var_dump (Array_unshift ($array, ' apple ', ' raspberry '));
Var_dump ($array);
/*
Int (4)
Array (4) {
[0]=>
String (5) "Apple"
[1]=>
String (9) "Raspberry"
[2]=>
String (6) "Orange"
[3]=>
String (6) "Banana"
}
*/
Excerpts from Zuodefeng's notes
http://www.bkjia.com/PHPjc/478193.html www.bkjia.com true http://www.bkjia.com/PHPjc/478193.html techarticle ARRAY_UNSHITF () inserts one or more cell "functions" at the beginning of the array the function inserts the incoming cell into the beginning of the specified array. Note that the unit is inserted as a whole, so pass ...