Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 20
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\mail_bbcode_include.php on line 21
Warning: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead in F:\OpenServer\domains\php-fusion.vveb.ws\includes\bbcodes\search_bbcode_include.php on line 39
PHP
<?php
-
function settings_array_for_write($query=array(), $query_name ='query') {
$t="";
foreach ($query as $k=>$v) {
// echo " $".$query_name."['".$k."'] = stripslashes('".addslashes(stripslashes($v))."');\n<br>";
$t .=
" $".$query_name."['".$k."'] = stripslashes('".addslashes(stripslashes($v))."');
";
}
return $t;
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
// преобразует одномерный массив в php-код и записывает в файл php
function array_write($arr=array('a01'=>'1a3151', 'b2'=>'htl', 'ct62'=>'657'), $array_name='vk_sek', $s_http_host='php-func' ) {
$w = "<"."?php
" . settings_array_for_write($arr, $array_name) . "
?".">";
@chmod ($array_name.'_'.$s_http_host.'.php', 0777);
fwrite_file($array_name.'_'.$s_http_host.'.php', $w);
@chmod ($array_name.'_'.$s_http_host.'.php', 0644);
-
}
-
-
function fwrite_file($file, $text) {
$temp = fopen($file, "w");
$r='';
if (fwrite($temp, $text)) {
//echo "<br> файл ".$file." сохранён\n";
$r=1; //$r=true;
} else {
//echo "<br> файл ".$file." <font color=red>НЕ</font> сохранён!\n";
$r=0; //$r=false;
}
fclose($temp);
if (file_exists($file)) @chmod($file, 0644);
return $r;
}
?>
|
Добавить комментарий Пожалуйста, залогиньтесь для добавления комментария.
|
|
<a href="https://php-fusion.vveb.ws/php-fusion.php?id=11&lang=ru"></a>
[url=https://php-fusion.vveb.ws/php-fusion.php?id=11&lang=ru][/url]
|