note 44345 deleted from function.array-merge by shenkong

From: Date: Sat, 07 Aug 2004 20:46:26 +0000
Subject: note 44345 deleted from function.array-merge by shenkong
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-74153@lists.php.net to get a copy of this message
Note Submitter: alwin@kommapuntkomma.nl ---- I found another quite simple solution for the type problem, by adding two lines before the array_merge() line: if(gettype($arr1) != "array") $arr1 = array("0" => $arr1); if(gettype($arr2) != "array") $arr2 = array("0" => $arr2); $result = array_merge($arr1,$arr2); Happy Coding!

« previous php.notes (#74153) next »