array_pad: Pad array to the specified length with a value
<?php
$states = array("A","B");
print "before pad:<br />";
print_r($states);
$states = array_pad($states,4,"C");
$states = array("A","B","C","D");
print "<br />after pad:<br />";
print_r($states);
?>
Related examples in the same category