Пример #1
0
 function fn_save()
 {
     if (SC) {
         $ne = !file_exists(PATH . "dumper.cfg.php");
         $fp = fopen(PATH . "dumper.cfg.php", "wb");
         fwrite($fp, "<?php\n\$this->SET = " . fn_arr2str($this->SET) . "\n?>");
         fclose($fp);
         if ($ne) {
             @chmod(PATH . "dumper.cfg.php", 0666);
         }
         $this->fn_index();
     }
 }
Пример #2
0
function fn_arr2str($array)
{
    $str = "array(\n";
    foreach ($array as $key => $value) {
        if (is_array($value)) {
            $str .= "'{$key}' => " . fn_arr2str($value) . ",\n\n";
        } else {
            $str .= "'{$key}' => '" . str_replace("'", "\\'", $value) . "',\n";
        }
    }
    return $str . ")";
}
Пример #3
0
function fn_arr2str($array)
{
    $str = "array(\n";
    foreach ($array as $key => $value) {
        if (is_array($value)) {
            $str .= "'{$key}' => " . fn_arr2str($value) . ",\n\n";
        } else {
            $str .= "'{$key}' => '" . addslashes($value) . "',\n";
        }
    }
    return $str . ")";
}