public static function ReturnPHPStrRec($arVal, $level, $comm = "") { $result = ""; $pref = str_repeat("\t", $level + 1); if (is_array($arVal)) { $result .= "array(" . ($level == 1 ? $comm : "") . "\n"; foreach ($arVal as $key => $value) { $result .= $pref . "\t" . (intval($key) . "|" == $key . "|" ? $key : PHPParser::PreparePHP($key)) . " => " . PHPParser::ReturnPHPStrRec($value, $level + 1); } $result .= $pref . "),\n"; } else { $result .= PHPParser::PreparePHP($arVal) . "," . ($level == 1 ? $comm : "") . "\n"; } return $result; }