本文整理汇总了PHP中General::str2array方法的典型用法代码示例。如果您正苦于以下问题:PHP General::str2array方法的具体用法?PHP General::str2array怎么用?PHP General::str2array使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类General
的用法示例。
在下文中一共展示了General::str2array方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: codeToDisplay
function codeToDisplay($code, $beautify = true, $linenumbers = true)
{
$code = htmlentities($code);
$lines = General::str2array($code);
$final_code = "";
$ii = 1;
foreach ($lines as $l) {
$l = trim($spaces . $l);
if ($l == "") {
$l = " ";
}
if ($linenumbers) {
$final_code .= "<li>{$l}</li>\n";
} else {
$final_code .= "{$l}\n";
}
$ii++;
}
if ($linenumbers) {
return "<ol>\n{$final_code}\n</ol>";
} else {
return "{$final_code}\n";
}
}
示例2: str_replace
$Site->addHeaderToPage("Content-Type", "text/html; charset=UTF-8");
## We dont want to see error messages if in debug mode
$Site->setVerbose(__IN_DEBUG_MODE__ ? false : true);
#Render the page
$Site->display();
if (!__IN_DEBUG_MODE__) {
print $Site->getTransformed();
} else {
$active = 'xml';
$xml = General::sanitize($Site->getXML());
$xsl = str_replace("\r\n", "\n", trim($Site->getXSL()));
$xsl = General::sanitize($xsl);
$output = General::sanitize($Site->getTransformed());
$xml = $xml != "" ? General::str2array($xml, false) : NULL;
$xsl = $xsl != "" ? General::str2array($xsl) : NULL;
$output = $output != "" ? General::str2array($output, false) : NULL;
$page_name = $db->fetchVar("title", 0, "SELECT `title` FROM `tbl_pages` WHERE `handle` = '" . $Site->_page . "'");
$page_id = $db->fetchVar("id", 0, "SELECT `id` FROM `tbl_pages` WHERE `handle` = '" . $Site->_page . "'");
$type = $_GET['line_numbers'] == 'false' ? 'ul' : 'ol';
$result = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Symphony | Debug > ' . $page_name . '</title>
<link rel="stylesheet" type="text/css" media="screen" href="' . URL . '/symphony/assets/debug.css" />
<script type="text/javascript" src="' . URL . '/symphony/assets/main.js"></script>
</head>
<body id="view">
<h1><a href="' . URL . '/symphony/?page=/blueprint/pages/edit/&id=' . $page_id . '" title="Edit this page.">' . $page_name . '</a></h1>
示例3: SymDate
*
* Symphony web publishing system
*
* Copyright 2004–2006 Twenty One Degrees Pty. Ltd.
*
* @version 1.7
* @licence https://github.com/symphonycms/symphony-1.7/blob/master/LICENCE
*
***/
print '<?xml version="1.0" encoding="utf-8"?>';
$date = new SymDate($Admin->getConfigVar("time_zone", "region"), $Admin->getConfigVar("date_format", "region"));
$GLOBALS['pageTitle'] = "Activity Logs";
$date = new SymDate($Admin->getConfigVar("time_zone", "region"), $Admin->getConfigVar("date_format", "region"));
$log = array();
if (@is_file(LOGS . "/" . $_REQUEST["_l"] . ".log")) {
$log = General::str2array(@file_get_contents(LOGS . "/" . $_REQUEST["_l"] . ".log"), false);
} else {
General::redirect("?page=/settings/logs/");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Symphony – <?php
print $GLOBALS['pageTitle'];
?>
</title>
<link rel="stylesheet" type="text/css" media="screen" href="assets/debug.css" />
<script type="text/javascript" src="assets/main.js"></script>