array_pad Pad array to the specified length with a value : Array Function : Data Structure PHP Source Code


PHP Source Code » Data Structure » Array Function »

 

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);
?>
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo Data Structure
» Array Function