Array_pad
(PHP4 >= 4.0b4)
Array_pad---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Packing array for specified length and value
Syntax: array array_pad (array input, int pad_size, mixed pad_value);
Description:
This function fills array arrays with arrays of size pad_size and value pad_value, and returns the padded array, if the argument pad_size is a positive number, padding to the right of the array and, if negative, padding to the left of the array. If the absolute value of the parameter pad_size is less than or equal to the length of the array input, it will not be padded.
Example:
<?php
$input = Array (12, 10, 9);
$result = Array_pad ($input, 5, 0);
Result is Array (12, 10, 9, 0, 0)
$result = Array_pad ($input,-7,-1);
Result is array (-1,-1,-1,-1, 12, 10, 9)
$result = Array_pad ($input, 2, "NoOp");
Not padded
?>