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


PHP General::str2array方法代码示例

本文整理汇总了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";
     }
 }
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:24,代码来源:class.general.php

示例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/&amp;id=' . $page_id . '" title="Edit this page.">' . $page_name . '</a></h1>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:30,代码来源:index.php

示例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 &ndash; <?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>
开发者ID:symphonycms,项目名称:symphony-1.7,代码行数:31,代码来源:sym_settings_logs_view.php


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