Return to Snippet

Revision: 25169
at March 22, 2010 15:38 by paramah


Initial Code
/**
 * Merge a group of arrays
 *
 * @param array First array
 * @param array Second array
 * @param array Third array
 * @param array Etc...
 * @return array All array parameters merged into one
 */
	function amerge() 
	{
		$r = array();
		foreach(func_get_args()as $a) 
		{
			if (!is_array($a)) 
			{
				$a = array($a);
			}
			$r = array_merge($r, $a);
		}
		return $r;
	}

Initial URL

                                

Initial Description

                                

Initial Title
Merge a group of arrays

Initial Tags
php, textmate, array

Initial Language
Other