[Fusionforge-commits] r14031 - trunk/src/common/include

Franck VILLAUME nerville at fusionforge.org
Tue Aug 2 15:06:27 CEST 2011


Author: nerville
Date: 2011-08-02 15:06:27 +0200 (Tue, 02 Aug 2011)
New Revision: 14031

Modified:
   trunk/src/common/include/utils.php
Log:
add flatten array util function

Modified: trunk/src/common/include/utils.php
===================================================================
--- trunk/src/common/include/utils.php	2011-08-02 13:04:31 UTC (rev 14030)
+++ trunk/src/common/include/utils.php	2011-08-02 13:06:27 UTC (rev 14031)
@@ -1539,6 +1539,19 @@
 	    ENT_QUOTES, "UTF-8");
 }
 
+/* return an array from an array of arrays of arrays of ... */
+function array_flatten($array) {
+	$returnedValue = array();
+	foreach ($array as $value) {
+		if(is_array($value)) {
+			$returnedValue = array_flatten($value);
+		} else {
+			$returnedValue[] = $value;
+		}
+	}
+	return $returnedValue;
+}
+
 // Local Variables:
 // mode: php
 // c-file-style: "bsd"




More information about the Fusionforge-commits mailing list