PHP Code
function Arr_Size_Match($Arr, $ArrSize, $ValueFill = '') {
	//Purpose
	//	Used to resize an array to match the size of another array.
	//Parameters
	//	Arr (Array) = The array we're going to resize.
	//	ArrSize (Array) = The resulting array will contain the same number of elements as this array.
	//	ValueFill (String) = If elements are added, this is the value for all new elements.
	//		Default: ""
	//Return (Array)
	//	Returns Arr resized so it has the same number of elements as ArrSize.
	//	If new elements were added, their keys are numeric only and their values are filled with ValueFill.
	//	If Arr is empty, function returns an empty array.
	//Version History
	//	1.0 2/5/07 10:06pm Tested by Russ Tanner on PHP 5
	//---
	
	// The "size" array is equal to the source array, just return the source array
	if (count($ArrSize) == count($Arr)) return $Arr;

	// The "size" array is smaller than the source array, remove elements from the source array
	if (count($ArrSize) < count($Arr)) return array_slice($Arr, 0, count($ArrSize));
	
	// The "size" array is larger then the source array, append elements to the source array
	return array_pad($Arr, count($ArrSize), $ValueFill);

}
 


The Captian
Today they call you "crazy". Tomorrow they call you "ahead of your time."
Global Skywatch Learn about Chemtrails - You're breathing them now!
OnlyTheBestHerbs.com World-class supplements
Mercury Talk Why you are sick.
OneUp Domains Domains, Hosting, Email
1-800-358-4278 (U.S. & Canada)