[Vtigercrm-commits] [vtiger-commits] r9348 - /vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Thu Sep 7 05:51:09 EDT 2006
Author: richie
Date: Thu Sep 7 03:50:58 2006
New Revision: 9348
Log:
Added a function to get the array in a single string
Modified:
vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php
Modified: vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php
==============================================================================
--- vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php (original)
+++ vtigercrm/trunk/modules/Users/CreateUserPrivilegeFile.php Thu Sep 7 03:50:58 2006
@@ -1317,6 +1317,38 @@
* @param $var -- input array:: Type array
* @returns $code -- contains the whole array in a single string:: Type array
*/
+function constructSingleStringKeyAndValueArray($var)
+{
+
+ $size = sizeof($var);
+ $i=1;
+ if (is_array($var))
+ {
+ $code = 'array(';
+ foreach ($var as $key => $value)
+ {
+ if($i<$size)
+ {
+ $code .= "'".$key."'=>".$value.",";
+ }
+ else
+ {
+ $code .= "'".$key."'=>".$value;
+ }
+ $i++;
+ }
+ $code .= ')';
+ return $code;
+ }
+}
+
+
+
+/** Converts the input array to a single string to facilitate the writing of the input array in a flat file
+
+ * @param $var -- input array:: Type array
+ * @returns $code -- contains the whole array in a single string:: Type array
+ */
function constructSingleStringKeyValueArray($var)
{
More information about the vtigercrm-commits
mailing list