本文整理汇总了PHP中file_write_contents函数的典型用法代码示例。如果您正苦于以下问题:PHP file_write_contents函数的具体用法?PHP file_write_contents怎么用?PHP file_write_contents使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了file_write_contents函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: multinet_rebuild_globalconf
function multinet_rebuild_globalconf()
{
global $ubillingConfig;
$altCfg = $ubillingConfig->getAlter();
$global_template = file_get_contents("config/dhcp/global.template");
$subnets_template = file_get_contents("config/dhcp/subnets.template");
$alldhcpsubnets_q = "SELECT `id`,`netid` from `dhcp` ORDER BY `id` ASC";
$alldhcpsubnets = simple_queryall($alldhcpsubnets_q);
$allMembers_q = "SELECT `ip` from `nethosts` WHERE `option` != 'NULL'";
$allMembers = simple_queryall($allMembers_q);
$membersMacroContent = '';
$vlanMembersMacroContent = '';
$onuMembersMacroContent = '';
if (!empty($allMembers)) {
foreach ($allMembers as $ix => $eachMember) {
$memberClass = 'm' . str_replace('.', 'x', $eachMember['ip']);
$membersMacroContent .= 'deny members of "' . $memberClass . '";' . "\n";
}
}
if (isset($altCfg['VLANGEN_SUPPORT'])) {
if ($altCfg['VLANGEN_SUPPORT']) {
$vlanMembers_q = "SELECT `ip` FROM `users` WHERE `login` IN(SELECT `login` FROM `vlanhosts`);";
$allVlanMembers = simple_queryall($vlanMembers_q);
if (!empty($allVlanMembers)) {
foreach ($allVlanMembers as $ivl => $eachVlanMember) {
$memberVlanClass = 'm' . str_replace('.', 'x', $eachVlanMember['ip']);
$vlanMembersMacroContent .= 'deny members of "' . $memberVlanClass . '";' . "\n";
}
}
}
}
$onuMembers_q = "SELECT `ip` FROM `nethosts` WHERE `netid` IN (SELECT `id` FROM `networks` WHERE `nettype` = 'dhcp82_bdcom' or `nettype` = 'dhcp82_zte');";
$allOnuMembers = simple_queryall($onuMembers_q);
if (!empty($allOnuMembers)) {
foreach ($allOnuMembers as $index => $eachOnuMember) {
$memberOnuClass = 'm' . str_replace('.', 'x', $eachOnuMember['ip']);
$onuMembersMacroContent .= 'deny members of "' . $memberOnuClass . '";' . "\n";
}
}
$subnets = '';
if (!empty($alldhcpsubnets)) {
foreach ($alldhcpsubnets as $io => $eachnet) {
$netdata = multinet_get_network_params($eachnet['netid']);
$templatedata['{STARTIP}'] = $netdata['startip'];
$templatedata['{ENDIP}'] = $netdata['endip'];
$templatedata['{CIDR}'] = explode('/', $netdata['desc']);
$templatedata['{NETWORK}'] = $templatedata['{CIDR}'][0];
$templatedata['{CIDR}'] = $templatedata['{CIDR}'][1];
$templatedata['{ROUTERS}'] = int2ip(ip2int($templatedata['{STARTIP}']) + 1);
$templatedata['{MASK}'] = multinet_cidr2mask($templatedata['{CIDR}']);
$dhcpdata = dhcp_get_data_by_netid($eachnet['netid']);
if (isset($dhcpdata['confname'])) {
$templatedata['{HOSTS}'] = $dhcpdata['confname'];
// check if override?
if (!empty($dhcpdata['dhcpconfig'])) {
$currentsubtpl = $dhcpdata['dhcpconfig'];
} else {
$currentsubtpl = $subnets_template;
}
$subnets .= multinet_ParseTemplate($currentsubtpl, $templatedata) . "\n";
}
}
}
$globdata['{SUBNETS}'] = $subnets;
$globdata['{DENYMEMBERS}'] = $membersMacroContent;
$globdata['{DENYVLANGENMEMBERS}'] = $vlanMembersMacroContent;
$globdata['{DENYONUMEMBERS}'] = $onuMembersMacroContent;
$globconf = multinet_ParseTemplate($global_template, $globdata);
file_write_contents("multinet/dhcpd.conf", $globconf);
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:70,代码来源:api.networking.php
示例2: output
function output($title, $content, $disposition = 'browser')
{
$_SERVER['PLANOWNER_DISPLAY_NAME'] = str_replace("'", "", $_SERVER['PLANOWNER_DISPLAY_NAME']);
$_SERVER['STOPWATCH']['content_end'] = array_sum(explode(' ', microtime()));
$_SERVER['STOPWATCH']['output_begin'] = array_sum(explode(' ', microtime()));
// if there is no cookie, user is 'guest'
if (!$_SERVER['USER']) {
$_SERVER['USER'] = 'guest';
}
if ($_SERVER['OUTPUT_MODE'] == 'HTML') {
Header("Content-type: text/html; charset=UTF-8");
$page = output_html($title, $content);
}
if ($_SERVER['OUTPUT_MODE'] == 'IPHONE') {
Header("Content-type: text/html; charset=UTF-8");
$page = output_iphone($title, $content);
}
if ($_SERVER['OUTPUT_MODE'] == 'RSS' || strstr($_SERVER['OUTPUT_MODE'], 'ATOM')) {
Header("Content-type: text/xml; charset=UTF-8");
$page = output_feed($title, $content);
}
if ($_SERVER['OUTPUT_MODE'] == 'AJAX') {
Header("Content-type: text/html; charset=UTF-8");
$page = output_ajax($title, $content);
}
if ($disposition == 'return') {
return $page;
}
if (strstr($disposition, $_SERVER['DOCUMENT_ROOT'])) {
file_write_contents($disposition, $page);
return $page;
}
echo $page;
exit;
}
开发者ID:joshuawdavidson,项目名称:planwatch,代码行数:35,代码来源:output.php
示例3: save_cache
function save_cache()
{
$this->CONTENT = ob_get_contents();
//Записываем буфер в переменную
rcms_delete_files($this->dir_cache . "/" . $this->hash_code);
file_write_contents($this->dir_cache . "/" . $this->hash_code, $this->CONTENT);
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:7,代码来源:cache.php
示例4: guestbook_remove_post
function guestbook_remove_post($file, $num, $config = false)
{
if ($data = @file_get_contents($file)) {
$data = unserialize($data);
}
unset($data[$num]);
file_write_contents($file, serialize($data));
return true;
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:9,代码来源:guestbook.php
示例5: write_rate
function write_rate($for, $val, $ip)
{
global $write;
if (!$write) {
$arr = array();
if (file_exists(RATE_PATH . $for)) {
$arr = unserialize(file_get_contents(RATE_PATH . $for));
}
$arr[$ip] = $val;
file_write_contents(RATE_PATH . $for, serialize($arr));
}
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:12,代码来源:rate.php
示例6: gallery_delete_comment
function gallery_delete_comment($id, $cid)
{
$images = rcms_scandir(GALLERY_PATH);
if ($data = @file_get_contents(GALLERY_PATH . $images[$id] . '.cm')) {
$data = unserialize($data);
} else {
return false;
}
if (isset($data[$cid])) {
unset($data[$cid]);
file_write_contents(GALLERY_PATH . $images[$id] . '.cm', serialize($data));
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:14,代码来源:index.php
示例7: ucm_delete
function ucm_delete($id)
{
$filename = basename($id) . '.ucm';
if (!is_file(DF_PATH . $filename)) {
return false;
}
if (rcms_delete_files(DF_PATH . $filename)) {
$config = file_get_contents(CONFIG_PATH . 'menus.ini');
$config = preg_replace('/[0-9]* = "ucm:' . $id . '"\\s/i', '', $config);
file_write_contents(CONFIG_PATH . 'menus.ini', $config);
return true;
} else {
return false;
}
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:15,代码来源:ucm.php
示例8: ucm_delete
function ucm_delete($id, $dir = MENU_MODULES_PATH)
{
$id = basename($id);
$workdir = $dir . 'ucm.' . $id;
if (is_dir($workdir)) {
if (rcms_delete_files($workdir, true)) {
$config = file_get_contents(CONFIG_PATH . 'menus.ini');
$config = preg_replace('/[0-9]* = "ucm.' . $id . '"\\s/i', '', $config);
if (!file_write_contents(CONFIG_PATH . 'menus.ini', $config)) {
return 6;
}
return 0;
} else {
return 4;
}
} else {
return 4;
}
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:19,代码来源:ucm.php
示例9: download_save_data_file
function download_save_data_file($file, $cont)
{
if (!is_writeable($file) && is_file($file)) {
return false;
}
$res = array();
foreach ($cont as $key => $value) {
if ($value !== false) {
$res[$key] = $value;
}
}
if (!($data = serialize($res))) {
return false;
}
if (!file_write_contents($file, $data)) {
return false;
}
return true;
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:19,代码来源:downloads.php
示例10: close
function close($uc = true, $uo = true)
{
if ($uc) {
if (!$this->copened) {
$this->openCurrentPolls();
}
$a = file_write_contents($this->polls_file, serialize($this->current));
}
if ($uo) {
if (!$this->oopened) {
$this->openArchivedPolls();
}
$b = file_write_contents($this->old_polls_file, serialize($this->old));
}
if ($uc && $uo) {
return $a && $b;
} elseif ($uo) {
return $b;
} elseif ($uc) {
return $a;
} else {
return true;
}
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:24,代码来源:poll.php
示例11: page_change
function page_change($id, $newid, $title, $text, $description, $keywords, $mode = 'html', $date)
{
global $system;
$id = basename($id);
$newid = basename($newid);
if (preg_replace("/[a-z0-9\\-\\_]*/i", '', $id) != '' || empty($id)) {
return false;
}
if (preg_replace("/[a-z0-9\\-\\_]*/i", '', $newid) != '' || empty($newid)) {
return false;
}
if (!is_file(PAGES_PATH . $id)) {
return false;
}
if ($id != $newid && is_file(PAGES_PATH . $newid)) {
return false;
}
$page = array('title' => $title, 'text' => $text, 'description' => $description, 'keywords' => $keywords, 'mode' => $mode, 'author_nick' => $system->user['nickname'], 'author_name' => $system->user['username'], 'date' => sql_to_unix_time($date));
if (!file_write_contents(PAGES_PATH . $id, serialize($page))) {
return false;
}
rcms_rename_file(PAGES_PATH . $id, PAGES_PATH . $newid);
return true;
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:24,代码来源:pages.php
示例12: rcms_parse_ini_file
$alter_conf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
if ($alter_conf['EXPORT_ENABLED']) {
$export_filepath = 'exports/';
$export_fileext = '.export';
if (wf_CheckGet(array('dlexf'))) {
zb_DownloadFile($export_filepath . vf($_GET['dlexf'], 3) . $export_fileext, 'default');
}
show_window(__('Export payments data'), zb_ExportForm());
if (isset($_POST['fromdate']) and isset($_POST['todate'])) {
$from_date = $_POST['fromdate'];
$to_date = $_POST['todate'];
//export types
//xml
if ($alter_conf['EXPORT_FORMAT'] == 'xml') {
$export_result = zb_ExportPayments($from_date, $to_date);
}
//dbf
if ($alter_conf['EXPORT_FORMAT'] == 'dbf') {
//need to be written
}
$export_filename = time();
$exported_link = wf_Link('?module=payexport&dlexf=' . $export_filename, wf_img('skins/icon_download.png') . ' ' . __('Exported data download'), false, 'ubButton');
file_write_contents($export_filepath . $export_filename . $export_fileext, $export_result);
show_window('', $exported_link);
}
} else {
show_error(__('Payments export not enabled'));
}
} else {
show_error(__('You cant control this module'));
}
开发者ID:nightflyza,项目名称:Ubilling,代码行数:31,代码来源:index.php
示例13: __
$prio = $_POST['priority'][$module];
include_once 'sitemap/' . $module . '.php';
}
}
$sitemap->sitemapFileName = $_POST['filename'];
$result = $sitemap->sitemapFileName . ' ' . __('added successfully') . '<br/>';
if (!empty($_POST['gz'])) {
$sitemap->createGZipFile = true;
$result .= $_POST['filename'] . '.gz ' . __('added successfully') . '<br/>';
}
$sitemap->createSitemap();
// create sitemap in memory
$sitemap->writeSitemap();
// write sitemap as file
if (isset($_POST['robots_txt'])) {
file_write_contents(RCMS_ROOT_PATH . 'robots.txt', $_POST['robots_txt']);
}
//save robots.txt
if (!empty($_POST['robots'])) {
//build new robots.txt
rcms_delete_files(RCMS_ROOT_PATH . 'robots.txt');
$sitemap->updateRobots();
$result .= 'robots.txt ' . __('added successfully') . '<br/>';
}
if (!empty($_POST['engines'])) {
// submit sitemaps to search engines
$result .= "<pre>";
$result .= $sitemap->submitSitemap('');
$result .= "</pre>";
}
$result .= __('Memory peak usage: ') . number_format(memory_get_peak_usage() / (1024 * 1024), 2) . "MB";
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:31,代码来源:sitemap.php
示例14: saveIndexFiles
function saveIndexFiles()
{
global $system;
if ($system->checkForRight('GALLERY')) {
file_write_contents(GALLERY_INDEXES_DIR . 'main.dat', serialize($this->indexes['main']));
file_write_contents(GALLERY_INDEXES_DIR . 'filename.dat', serialize($this->indexes['filename']));
file_write_contents(GALLERY_INDEXES_DIR . 'title.dat', serialize($this->indexes['title']));
file_write_contents(GALLERY_INDEXES_DIR . 'size.dat', serialize($this->indexes['size']));
file_write_contents(GALLERY_INDEXES_DIR . 'type.dat', serialize($this->indexes['type']));
file_write_contents(GALLERY_INDEXES_DIR . 'keywords.dat', serialize($this->indexes['keywords']));
}
return true;
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:13,代码来源:api.gallery.php
示例15: mkdir
if (!is_dir(DATA_PATH . 'help/')) {
mkdir(DATA_PATH . 'help/', 0777);
}
if (!is_dir($help_dir)) {
mkdir($help_dir, 0777);
}
if (!empty($_GET['delete'])) {
$dfile = $help_dir . '/' . get('delete');
if (rcms_delete_files($dfile)) {
show_window(__('Result'), __('File removed'));
} else {
show_window(__('Result'), __('Error occurred') . ':' . $dfile);
}
}
if (!empty($_POST['save']) && !empty($module)) {
file_write_contents($file, $_POST['help_edit']);
show_window(__('Result'), __('File updated') . '. ' . __('Show') . ' — ' . show_help($module));
}
if (!empty($module)) {
$result = file_exists($file) ? file_get_contents($file) : '';
$frm = new InputForm('', 'post', __('Submit'));
$frm->hidden('save', '1');
$frm->addrow('', $frm->textarea('help_edit', $result, 55, 15) . tinymce_selector('help_edit'), 'top');
$result = $frm->show(true);
show_window(__('Help') . ' ' . __('for the module') . ' ' . get('edit') . ': ' . __('Edit'), $result, 'center');
} else {
$files = rcms_scandir($help_dir);
if (!empty($files)) {
$result = '<table width="100%">';
foreach ($files as $helpfile) {
$admin_link = '
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:31,代码来源:index.php
示例16: InputForm
$frm = new InputForm(RCMS_ROOT_PATH, "post", $lang['users']['login'], '_top');
$frm->addbreak($lang['admin_cp']['notlogged']);
$frm->hidden('login_form', '1');
$frm->addrow($lang['users']['username'], $frm->text_box("username", '', 20), 'top');
$frm->addrow($lang['users']['password'], $frm->text_box("password", '', 20, 50, true), 'top');
$frm->addrow($lang['users']['remember'], $frm->checkbox("remember", '1', ''), 'top');
$frm->show();
} else {
$rights =& $system->rights;
if ($rights === array()) {
$frm = new InputForm(RCMS_ROOT_PATH, "get", $lang['general']['return'], '_top');
$frm->addbreak($lang['admin_cp']['loggedbutnotadmin']);
$frm->show();
} else {
if (isset($_POST['remarks'])) {
file_write_contents(DATA_PATH . 'admin_remarks.txt', $_POST['remarks']);
}
$frm = new InputForm('', "post", $lang['general']['submit']);
$frm->addbreak($lang['admin_cp']['loggedok']);
if ($rights !== 'ROOT') {
foreach ($rights as $right => $right_desc) {
$frm->addrow($right, $right_desc, 'top');
}
} else {
$frm->addrow($lang['users']['youareroot']);
}
$frm->addbreak($lang['admin_cp']['remarks']);
$frm->addrow($frm->textarea('remarks', file_get_contents(DATA_PATH . 'admin_remarks.txt'), 60, 10), '', 'middle', 'center');
$frm->show();
}
}
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:31,代码来源:index.php
示例17: cpm_handle_file_uploads
/**
* Handle uploading a set of files.
* @param array $files A list of valid $_FILES keys to process.
*/
function cpm_handle_file_uploads($files)
{
global $cpm_config;
$posts_created = array();
$duplicate_posts = array();
$files_uploaded = array();
$thumbnails_written = array();
$invalid_filenames = array();
$thumbnails_not_written = array();
$files_not_uploaded = array();
$invalid_image_types = array();
$gd_rename_file = array();
$did_convert_cmyk_jpeg = array();
$target_root = CPM_DOCUMENT_ROOT . '/' . $cpm_config->properties[$_POST['upload-destination'] . "_folder"];
if (($subdir = cpm_get_subcomic_directory()) !== false) {
$target_root .= '/' . $subdir;
}
$write_thumbnails = isset($_POST['thumbnails']) && $_POST['upload-destination'] == "comic";
$new_post = isset($_POST['new_post']) && $_POST['upload-destination'] == "comic";
$ok_to_keep_uploading = true;
$files_created_in_operation = array();
$filename_original_titles = array();
foreach ($files as $key) {
if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
if ($_FILES[$key]['error'] != 0) {
switch ($_FILES[$key]['error']) {
case UPLOAD_ERR_INI_SIZE:
case UPLOAD_ERR_FORM_SIZE:
$cpm_config->warnings[] = sprintf(__("<strong>The file you uploaded was too large.</strong> The max allowed filesize for uploads to your server is %s.", 'comicpress-manager'), ini_get('upload_max_filesize'));
break;
case UPLOAD_ERR_NO_FILE:
break;
default:
$cpm_config->warnings[] = sprintf(__("<strong>There was an error in uploading.</strong> The <a href='http://php.net/manual/en/features.file-upload.errors.php'>PHP upload error code</a> was %s.", 'comicpress-manager'), $_FILES[$key]['error']);
break;
}
} else {
if (strpos($_FILES[$key]['name'], ".zip") !== false) {
$invalid_files = array();
//harmonious zip_open zip_entry_name zip_read zip_entry_read zip_entry_open zip_entry_filesize zip_entry_close zip_close
if (extension_loaded("zip")) {
if (is_resource($zip = zip_open($_FILES[$key]['tmp_name']))) {
while ($zip_entry = zip_read($zip)) {
if (zip_entry_open($zip, $zip_entry, "r")) {
$temp_path = $target_root . '/' . md5(rand());
file_write_contents($temp_path, zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)));
$comic_file = zip_entry_name($zip_entry);
$target_filename = pathinfo(zip_entry_name($zip_entry), PATHINFO_BASENAME);
$result = cpm_breakdown_comic_filename($target_filename, true);
if (file_exists($temp_path)) {
extract(cpm_do_gd_file_check_on_upload($temp_path, $target_filename));
if ($result !== false) {
extract($result, EXTR_PREFIX_ALL, "filename");
if ($file_ok) {
if (($obfuscated_filename = cpm_obfuscate_filename($target_filename)) !== $target_filename) {
$cpm_config->messages[] = sprintf(__('Uploaded file %1$s renamed to %2$s.', 'comicpress-manager'), $target_filename, $obfuscated_filename);
$filename_original_titles[$obfuscated_filename] = $result['converted_title'];
$target_filename = $obfuscated_filename;
}
@rename($temp_path, $target_root . '/' . $target_filename);
$files_created_in_operation[] = $target_root . '/' . $target_filename;
$files_uploaded[] = $target_filename;
if ($gd_did_rename) {
$gd_rename_file[] = $comic_file;
}
if ($did_filecheck) {
if ($is_cmyk) {
$did_convert_cmyk_jpeg[] = $comic_file;
}
}
} else {
if ($did_filecheck) {
$invalid_image_types[] = $comic_file;
} else {
$invalid_filenames[] = $comic_file;
}
}
} else {
$files_not_uploaded[] = $comic_file;
}
} else {
$invalid_filenames[] = $comic_file;
}
@unlink($temp_path);
zip_entry_close($zip_entry);
}
if (($result = cpm_breakdown_comic_filename($target_filename, true)) !== false) {
extract($result, EXTR_PREFIX_ALL, 'filename');
$target_path = $target_root . '/' . $target_filename;
if (isset($_POST['upload-date-format']) && !empty($_POST['upload-date-format'])) {
$target_filename = date(CPM_DATE_FORMAT, strtotime($result['date'])) . $result['title'] . '.' . pathinfo($_FILES[$key]['name'], PATHINFO_EXTENSION);
}
} else {
$invalid_filenames[] = $comic_file;
}
}
//.........这里部分代码省略.........
开发者ID:johnbintz,项目名称:comicpress-manager-1.4,代码行数:101,代码来源:comicpress_manager_admin.php
示例18: saveIndex
function saveIndex()
{
if (empty($this->container)) {
$this->last_error = __('No section selected!');
return false;
}
if (($data = serialize($this->index)) === false) {
$this->last_error = __('Error while converting index');
return false;
}
if (!file_write_contents(ARTICLES_PATH . $this->container . '/index', $data)) {
$this->last_error = __('Error while saving index');
return false;
}
return true;
}
开发者ID:l1ght13aby,项目名称:Ubilling,代码行数:16,代码来源:api.articles.php
示例19: user_get_list
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<link rel="stylesheet" href="./style.css" type="text/css">
</head>
<body>
<table cellspacing="1" cellpadding="3" border="0" width="100%">
<tr>
<th colspan="3">ReloadCMS 1.0.X create users cache</th>
</tr>
<?php
$users = user_get_list('*');
if (!is_file(DATA_PATH . 'users.cache.dat')) {
$cache = array();
} else {
$cache = @unserialize(@file(DATA_PATH . 'users.cache.dat'));
}
foreach ($users as $userdata) {
$cache['nicks'][$userdata['username']] = $userdata['nickname'];
$cache['mails'][$userdata['username']] = $userdata['email'];
echo '
<tr>
<td width="100%" class="row1" style="color: green">' . $userdata['nickname'] . '</td>
<td class="row2" nowrap>' . $userdata['email'] . '</td>
</tr>';
}
file_write_contents(DATA_PATH . 'users.cache.dat', serialize($cache));
?>
</table>
</body>
</html>
开发者ID:BackupTheBerlios,项目名称:reloadcms-svn,代码行数:31,代码来源:create_cache.php
示例20: write_ini_file
function write_ini_file($data, $filename, $process_sections = false)
{
$ini = '';
if (!$process_sections) {
if (is_array($data)) {
foreach ($data as $key => $value) {
$ini .= $key . ' = "' . str_replace('"', '"', $value) . "\"\n";
}
}
} else {
if (is_array($data)) {
foreach ($data as $key => $value) {
$ini .= '[' . $key . ']' . "\n";
foreach ($value as $ekey => $evalue) {
$ini .= $ekey . ' = "' . str_replace('"', '"', $evalue) . "\"\n";
}
}
}
}
return file_write_contents($filename, $ini);
}
开发者ID:Parashutik,项目名称:ReloadCMS,代码行数:21,代码来源:filesystem.php
注:本文中的file_write_contents函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论