$val) $ret[$key] = json_encode(static :: parseValue($val)); return $ret; } /** * Return the update value of the attribute after handling it acording to its LDAP type * * @param mixed $data The attribute value * * @return array The processed attribute value */ public function getUpdateData($data) { $ret = array(); foreach(ensureIsArray($data) as $key => $val) $ret[$key] = static :: encodeValue(json_decode($val, true)); return $ret; } /** * Parse a value * @param string $value The value to parse * @return array|null The parse value as array, or null in case of error */ public static function parseValue($value) { if (preg_match_all('/\[([^=]*)=([^\]]*)\]/', $value, $matches)) { $parseValue = array(); for($i=0; $i $val) $ret .= "[$key=$val]"; return $ret; } return False; } }