note 98344 deleted from language.types.array by danbrown

From: Date: Wed, 09 Jun 2010 23:30:19 +0000
Subject: note 98344 deleted from language.types.array by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-170006@lists.php.net to get a copy of this message
Note Submitter: william at cycronsystems dot com ---- I couldn't find a way to Trim an array in PHP so i wrote this little function that seemed to do the trick. It will trim the array down to a specified size <?php //Utility Function to Trim Array function trim_array(array $array,$int){ $newArray = array(); for($i=0; $i<$int; $i++){ array_push($newArray,$array[$i]); } return (array)$newArray; } ?>

« previous php.notes (#170006) next »