Previous | Home | Next |
array_pad()
The array_pad() function inserts a specified number of elements, with a specified value, to an array.
Syntax:array_pad(array,size,value)
In above syntax,"array" specifies an array, "size" specifies the number of elements in the array returned from the function and "value" specifies the value of the new elements in the array returned from the function
Example:
<?php $a=array("Apple","Mango"); print_r(array_pad($a,5,"Orange")); ?>
Output:
Previous | Home | Next |