$sValue2)
{
$paArray1[$sKey2] = array_merge_recursive2( getArrayValue($paArray1,$sKey2), $sValue2);
}
return $paArray1;
}
if (!function_exists('print_pre')) {
/**
* Same as print_r, budet designed for viewing in web page
*
* @param Array $data
* @param string $label
*/
function print_pre($data, $label='')
{
if( defined('DEBUG_MODE') && DEBUG_MODE )
{
global $debugger;
if($label) $debugger->appendHTML(''.$label.'');
$debugger->dumpVars($data);
}
else
{
if($label) echo '',$label,'
';
echo '
',print_r($data,true),''; } } } if (!function_exists('getArrayValue')) { /** * Returns array value if key exists * * @param Array $array searchable array * @param int $key array key * @return string * @access public */ // function getArrayValue(&$array,$key) { $ret = isset($array[$key]) ? $array[$key] : false; if ($ret && func_num_args() > 2) { for ($i = 2; $i < func_num_args(); $i++) { $cur_key = func_get_arg($i); $ret = getArrayValue( $ret, $cur_key ); if ($ret === false) break; } } return $ret; } } /** * Rename key in associative array, maintaining keys order * * @param Array $array Associative Array * @param mixed $old Old key name * @param mixed $new New key name * @access public */ function array_rename_key(&$array, $old, $new) { foreach ($array as $key => $val) { $new_array[ $key == $old ? $new : $key] = $val; } $array = $new_array; } /** * Define constant if it was not already defined before * * @param string $const_name * @param string $const_value * @access public */ function safeDefine($const_name, $const_value) { if(!defined($const_name)) define($const_name,$const_value); } if( !function_exists('parse_portal_ini') ) { function parse_portal_ini($file, $parse_section = false) { if( !file_exists($file) && !is_readable($file) ) die('Could Not Open Ini File'); $contents = file($file); $retval = Array(); $section = ''; $ln = 1; $resave = false; foreach($contents as $line) { if ($ln == 1 && $line != '<'.'?'.'php die() ?'.">\n") { $resave = true; } $ln++; $line = trim($line); $line = eregi_replace(';[.]*','',$line); if(strlen($line) > 0) { //echo $line . " - "; if(eregi('^[[a-z]+]$',str_replace(' ', '', $line))) { //echo 'section'; $section = substr($line,1,(strlen($line)-2)); if ($parse_section) { $retval[$section] = array(); } continue; } elseif(eregi('=',$line)) { //echo 'main element'; list($key,$val) = explode(' = ',$line); if (!$parse_section) { $retval[trim($key)] = str_replace('"', '', $val); } else { $retval[$section][trim($key)] = str_replace('"', '', $val); } } //end if //echo '