当前位置: 首页>>代码示例>>PHP>>正文


PHP arraykeys2函数代码示例

本文整理汇总了PHP中arraykeys2函数的典型用法代码示例。如果您正苦于以下问题:PHP arraykeys2函数的具体用法?PHP arraykeys2怎么用?PHP arraykeys2使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了arraykeys2函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: getval

 $sqlcharset = getval('sqlcharset');
 $extendins = getval('extendins');
 $sqlcompat = getval('sqlcompat');
 $usehex = intval(getval('usehex'));
 $_SGLOBAL['db']->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
 //Error-free execution off the table and I create a column without quotes
 if (empty($filename) || strlen($filename) > 40) {
     //Determine the length of the file name
     cpmessage('documents_were_incorrect_length');
 } else {
     $filename = preg_replace("/[^a-z0-9_]/i", '', str_replace('.', '_', $filename));
 }
 $tables = array();
 // backup mode
 if ($type == 'uchomes') {
     $tables = arraykeys2(fetchtablelist($tablepre), 'Name');
 } elseif ($type == 'custom') {
     if (isset($_POST['setup'])) {
         //POST submit backup
         $tables = empty($_POST['customtables']) ? array() : $_POST['customtables'];
         data_set('custombackup', $tables);
     } else {
         //Jump backup automatically
         $tables = data_get('custombackup');
         $tables = unserialize($tables);
     }
 }
 if (empty($tables) || !is_array($tables)) {
     cpmessage('backup_table_wrong');
 }
 $time = sgmdate('Y-m-d H:i:s', $_SGLOBAL['timestamp']);
开发者ID:v998,项目名称:discuzx-en,代码行数:31,代码来源:admincp_backup.php

示例2: sql_run

     if ($admin_runquery) {
         $result = sql_run($_POST['sql_content']);
         if ($result) {
             flash("success");
         } else {
             flash();
         }
     } else {
         flash("admin_runquery_forbidden");
     }
 }
 if ($do == "backup") {
     $filename = date('ymd') . '_' . pb_radom(6);
     $db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');
     $time = gmdate("M d Y H:i:s", mktime(date("H"), date("i"), date("s"), date("m"), date("d"), date("Y")));
     $tables = arraykeys2(fetchtablelist($tb_prefix), 'Name');
     if (mysql_get_server_info() > '4.1') {
         $db->query("set names '" . $dbcharset . "'");
     }
     $backupfilename = DATA_PATH . "backup_" . $backupdir . DS . str_replace(array('/', '\\', '.'), '', $filename);
     $sqldump = '';
     $tableid = 0;
     $startfrom = 0;
     for (; $tableid < count($tables); $tableid++) {
         $sqldump .= sqldumptable($tables[$tableid], $startfrom, strlen($sqldump));
         $startfrom = 0;
     }
     $dumpfile = $backupfilename . '.sql';
     $tableid--;
     if (trim($sqldump)) {
         $fp = file_put_contents($dumpfile, $sqldump);
开发者ID:renduples,项目名称:alibtob,代码行数:31,代码来源:db.php

示例3: gmdate

<input class="button" type="submit" name="exportsubmit" value="<?=$lang['submit']?>"></center></form>
<?

	} else {

		$db->query('SET SQL_QUOTE_SHOW_CREATE=0', 'SILENT');

		if(!$filename || preg_match("/(\.)(exe|jsp|asp|aspx|cgi|fcgi|pl)(\.|$)/i", $filename)) {
			cpmsg('database_export_filename_invalid');
		}

		$time = gmdate("$dateformat $timeformat", $timestamp + $timeoffset * 3600);
		if($type == 'discuz') {
			$tables = arraykeys2(fetchtablelist($tablepre), 'Name');
		} elseif($type == 'discuzsupesite') {
			$tables = arraykeys2(array_merge(fetchtablelist($tablepre), ($supe['tablepre'] ? fetchtablelist($supe['tablepre']) : array())), 'Name');
		} elseif($type == 'custom') {
			$tables = array();
			if(empty($setup)) {
				if($tables = $db->fetch_first("SELECT value FROM {$tablepre}settings WHERE variable='custombackup'")) {
					$tables = unserialize($tables['value']);
				}
			} else {
				$customtables= array_merge(empty($customtables) ? array() : $customtables, empty($supetables) ? array() : $supetables);
				$customtablesnew = empty($customtables)? '' : addslashes(serialize($customtables));
				$db->query("REPLACE INTO {$tablepre}settings (variable, value) VALUES ('custombackup', '$customtablesnew')");
				$tables = & $customtables;
			}
			if( !is_array($tables) || empty($tables)) {
				cpmsg('database_export_custom_invalid');
			}
开发者ID:jonycookie,项目名称:projectm2,代码行数:31,代码来源:database.inc.php


注:本文中的arraykeys2函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。