phpgroupware-cvs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Phpgroupware-cvs] CVS: phpgwapi/inc php3_support_functions.inc.php,1.11


From: Jason Wies <address@hidden>
Subject: [Phpgroupware-cvs] CVS: phpgwapi/inc php3_support_functions.inc.php,1.11,1.11.2.1
Date: Wed, 16 Jan 2002 01:47:42 -0500

Update of /cvsroot/phpgroupware/phpgwapi/inc
In directory subversions:/tmp/cvs-serv31606

Modified Files:
      Tag: Version-0_9_14-branch
        php3_support_functions.inc.php 
Log Message:
Add array_merge ()

Index: php3_support_functions.inc.php
===================================================================
RCS file: /cvsroot/phpgroupware/phpgwapi/inc/php3_support_functions.inc.php,v
retrieving revision 1.11
retrieving revision 1.11.2.1
diff -C2 -r1.11 -r1.11.2.1
*** php3_support_functions.inc.php      7 Jan 2002 10:50:42 -0000       1.11
--- php3_support_functions.inc.php      16 Jan 2002 06:47:40 -0000      1.11.2.1
***************
*** 43,46 ****
--- 43,78 ----
        }
  
+       /* array_merge (PHP 4 >= 4.0.0)
+        *   array array_merge (array array1, array array2 [, array ...])
+        * array_merge() merges the elements of two or more arrays together so 
that the values
+        * of one are appended to the end of the previous one. It returns the 
resulting array.
+        */
+       function array_merge ($array1, $array2, $array3 = '', $array4 = '', 
$array5 = '', $array6 = '', $array7 = '', $array8 = '', $array9 = '', $array10 
= '')
+       {
+               $rarray = array ();
+ 
+               for ($i = 1; $i <= 10; $i++)
+               {
+                       $this_array = ${'array' . $i};
+                       if (is_array ($this_array))
+                       {
+                               reset ($this_array);
+                               while (list ($key, $value) = each ($this_array))
+                               {
+                                       if (is_int ($key))
+                                       {
+                                               $rarray[] = $value;
+                                       }
+                                       else
+                                       {
+                                               $rarray[$key] = $value;
+                                       }
+                               }
+                       }
+               }
+ 
+               return $rarray;
+       }
+ 
        /* array_pop (PHP 4 >= 4.0.0)
         *   mixed array_pop (array array)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]