• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP xml_escape函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: print_table

function print_table($name, $campaign_list)
{
    echo '	<div class="BlueBox">' . "\n";
    echo '		<h2>' . xml_escape($name) . '</h2>' . "\n";
    echo '		<table width="90%" cellpadding="3" align="center">' . "\n";
    echo '			<thead>' . "\n";
    echo '				<tr>' . "\n";
    echo '					<th width="80%">Name</th>' . "\n";
    echo '					<th width="20%">Petitioned</th>' . "\n";
    echo '				</tr>' . "\n";
    echo '			</thead>' . "\n";
    echo '			<tbody>' . "\n";
    foreach ($campaign_list as $key => $campaign) {
        echo '				<tr>' . "\n";
        echo '					<td><a href="/office/campaign/editarticle/' . $key . '">' . xml_escape($campaign['name']) . '</a></td>' . "\n";
        if ($campaign['has_been_petitioned'] == 1) {
            echo '					<td>yes</td>' . "\n";
        } else {
            echo '					<td>no</td>' . "\n";
        }
        echo '				</tr>' . "\n";
    }
    echo '			</tbody>' . "\n";
    echo '		</table>' . "\n";
    echo '	</div>' . "\n";
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:26,代码来源:list.php


示例2: SetWikiparser

    function SetWikiparser($wiki = null, $preview = true)
    {
        $this->wikiparser = $wiki;
        $this->preview = $preview;
        // Generate preview for ajax?
        if ($preview && isset($_GET['input_wikitext_preview_field']) && $_GET['input_wikitext_preview_field'] == $this->name) {
            if (null === $this->wikiparser) {
                get_instance()->load->library('Wikiparser');
                $parser = new Wikiparser();
            } else {
                $parser =& $this->wikiparser;
            }
            if (isset($_POST['input_wikitext_preview'])) {
                $xml = $parser->parse($_POST['input_wikitext_preview']);
            } else {
                $xml = "POST input_wikitext_preview missing";
            }
            header('content-type: text/xml');
            ?>
<<?php 
            ?>
?xml version="1.0" encoding="UTF-8"?><?php 
            ?>
<wikitext><?php 
            echo xml_escape($xml);
            ?>
</wikitext><?php 
            exit(0);
        }
    }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:30,代码来源:input_wikitext_helper.php


示例3: printInput

function printInput($title, $name, $type, $value, $section, $access, $user_level)
{
    $name = xml_escape($name);
    $title = xml_escape($title);
    $value = xml_escape($value);
    if ($type != 'submit') {
        echo '<label for="' . $name . '">' . $title . ':</label>';
    }
    if ($access[$section][$user_level]) {
        switch ($type) {
            case 'textarea':
                echo '<textarea name="' . $name . '" id="' . $name . '" cols="25" rows="5">' . $value . '</textarea>';
                break;
            case 'submit':
                echo '<input type="' . $type . '" name="' . $name . '" id="' . $name . '" value="' . $value . '" class="button" />';
                break;
            default:
                echo '<input type="' . $type . '" name="' . $name . '" id="' . $name . '" value="' . $value . '" size="30" />';
                break;
        }
    } else {
        if ($type != 'submit') {
            echo '<div id="' . $name . '" style="float:left;margin:5px 10px;">' . $value . '</div>';
        }
    }
    echo '<br />';
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:27,代码来源:view.php


示例4: printarticlelink

function printarticlelink($article)
{
    echo '	<div style="border-bottom:1px #999 solid;">' . "\n";
    echo '				<a href="/news/' . $article['type_codename'] . '/';
    if (!empty($article['organisation_codename'])) {
        echo $article['organisation_codename'] . '/';
    }
    //for reviews
    echo $article['id'] . '">' . "\n";
    echo '			' . $article['photo_xhtml'] . "\n";
    echo '		</a>' . "\n";
    echo '		<div class="ArticleEntry">' . "\n";
    echo '			<h3 class="Headline">' . "\n";
    if (!empty($article['organisation_codename'])) {
        //If the article has an org name, it is a review.
        echo '				<a href="/reviews/' . $article['type_codename'] . '/' . $article['organisation_codename'] . '/';
    } else {
        echo '				<a href="/news/' . $article['type_codename'] . '/';
    }
    echo $article['id'] . '">' . "\n";
    echo '					' . xml_escape($article['heading']) . "\n";
    echo '				</a>' . "\n";
    echo '			</h3>' . "\n";
    echo '			<div class="Section" style="float:right;">' . xml_escape($article['type_name']) . '</div>' . "\n";
    echo '			<div class="Date">' . date('D, jS F Y', $article['date']) . '</div>' . "\n";
    echo '			<div class="Author">' . "\n";
    foreach ($article['reporters'] as $reporter) {
        echo '				<a href="/news/archive/reporter/' . $reporter['id'] . '/">' . xml_escape($reporter['name']) . '</a>' . "\n";
    }
    echo '			</div>' . "\n";
    echo '		</div>' . "\n";
    echo '		<p>' . xml_escape($article['blurb']) . '</p>' . "\n";
    echo '	</div>' . "\n";
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:34,代码来源:archive.php


示例5: log

 function log()
 {
     if (!CheckPermissions('admin')) {
         return;
     }
     $this->load->helper('url');
     $bulk = 'Valid logs are ' . anchor('admin/dev/log/web/', 'log/web') . ' and ' . anchor('admin/dev/log/irc/', 'log/irc') . '.';
     $segments = $this->uri->segment_array();
     switch ($this->uri->segment(4)) {
         case "web":
             $web = dir('../log');
             while (false !== ($entry = $web->read())) {
                 if ($entry != '.' or $entry != '..') {
                     $bulk .= '<p>' . anchor('admin/dev/log/web/' . $entry, $entry) . '</p>';
                 }
             }
             if ($this->uri->segment(5)) {
                 $bulk .= nl2br(file_get_contents('../log/' . $this->uri->segment(5)));
             }
             break;
         case "irc":
             $irc = dir('../supybot/logs/ChannelLogger/afsmg/#theyorker');
             while (false !== ($entry = $irc->read())) {
                 $entry = trim($entry, '#');
                 $bulk .= '<p>' . anchor('admin/dev/log/irc/' . $entry, $entry) . '</p>';
             }
             if ($this->uri->segment(5)) {
                 $bulk .= nl2br(xml_escape(file_get_contents('../supybot/logs/ChannelLogger/afsmg/#theyorker/#' . $this->uri->segment(5))));
             }
             break;
     }
     $this->main_frame->SetContent(new SimpleView($bulk));
     $this->main_frame->SetTitle('Log Viewer');
     $this->main_frame->Load();
 }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:35,代码来源:dev.php


示例6: printarticlelink

function printarticlelink($article)
{
    echo '	<div class="Entry">' . "\n";
    echo '		<a href="/news/' . $article['article_type'] . '/' . $article['id'] . '">' . "\n";
    echo '			' . $article['photo_xhtml'] . "\n";
    echo '		</a>' . "\n";
    if (!array_key_exists('blurb', $article)) {
        echo '		<div class="ArticleEntry">' . "\n";
    }
    echo '		<h3 class="Headline">' . "\n";
    echo '			<a href="/news/' . $article['article_type'] . '/' . $article['id'] . '">' . "\n";
    echo '				' . xml_escape($article['heading']) . "\n";
    echo '			</a>' . "\n";
    echo '		</h3>' . "\n";
    echo '		<div class="Date">' . $article['date'] . '</div>' . "\n";
    echo '		<div class="Author">' . "\n";
    foreach ($article['authors'] as $reporter) {
        echo '			<a href="/news/archive/reporter/' . $reporter['id'] . '/">' . xml_escape($reporter['name']) . '</a>' . "\n";
    }
    echo '		</div>' . "\n";
    if (!array_key_exists('blurb', $article)) {
        echo '		</div>' . "\n";
    }
    if (array_key_exists('blurb', $article) && $article['blurb'] != '') {
        echo '		<p>' . xml_escape($article['blurb']) . '</p>' . "\n";
    }
    echo '	</div>' . "\n";
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:28,代码来源:news.php


示例7: write_xml

function write_xml($subtags, $label = NULL)
{
    if (NULL !== $subtags) {
        if (NULL !== $label) {
            $attributes = '';
            if (is_array($subtags) && isset($subtags['_attr']) && is_array($subtags['_attr'])) {
                foreach ($subtags['_attr'] as $attribute => $value) {
                    $attributes .= " {$attribute}=\"" . xml_escape($value) . '"';
                }
            }
            echo '<' . $label . $attributes . '>';
        }
        if (is_array($subtags)) {
            foreach ($subtags as $tag => $content) {
                if (substr($tag, 0, 1) == '_') {
                    continue;
                }
                if (is_numeric($tag)) {
                    if (is_array($content) && isset($content['_tag'])) {
                        $tag = $content['_tag'];
                    } else {
                        $tag = NULL;
                    }
                }
                write_xml($content, $tag);
            }
        } else {
            echo xml_escape($subtags);
        }
        if (NULL !== $label) {
            echo '</' . $label . '>';
        }
    }
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:34,代码来源:xml_helper.php


示例8: DoTeam

function DoTeam($team, $in_list = TRUE)
{
    if ($in_list) {
        echo '<li>';
    }
    if (isset($team['notices'])) {
        echo '<a href="">';
    }
    echo xml_escape($team['name']);
    if (isset($team['notices'])) {
        echo ' (' . count($team['notices']) . ' notices)';
        echo '</a>';
    }
    if (!empty($team['subteams'])) {
        echo '<ul>';
        foreach ($team['subteams'] as $subteam) {
            DoTeam($subteam);
        }
        echo '</ul>';
    }
    if ($in_list) {
        echo '</li>';
    }
    return count($team['subteams']);
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:25,代码来源:directory_notices.php


示例9: dir_walk

function dir_walk($path = '', $depth = 0)
{
    if ($path == '') {
        $apath = './';
    } else {
        if (substr($path, -1, 1) != '/') {
            $path .= '/';
        }
        $apath = $path;
    }
    $out = array();
    $ds = utf8_encode(str_repeat("� � ", $depth));
    foreach (scandir($apath) as $v) {
        if (substr($v, 0, 1) == '.') {
            continue;
        }
        if (is_dir($apath . $v)) {
            printf("%s+ <b>%s</b><br/>\n", $ds, xml_escape($path . $v));
            dir_walk($path . $v, $depth + 1);
            print "<br/>\n";
        } else {
            if (ext($v) == 'pyc' || $path == '' && $v == 'index.php') {
                continue;
            }
            $out[] = $v;
        }
    }
    foreach ($out as $file) {
        printf("%s<a href=\"?sauce=%s\">%s</a><br/>\n", $ds, urlencode($path . $file), xml_escape($file));
    }
}
开发者ID:RayLennox,项目名称:up,代码行数:31,代码来源:source.php


示例10: ArticleList

function ArticleList($section, $articles, $last = false)
{
    if (count($articles) == 0) {
        return;
    }
    ?>
	<div class="ArticleListBox FlexiBox Box13<?php 
    if ($last) {
        echo ' FlexiBoxLast';
    }
    ?>
">
		<div class="ArticleListTitle">
			<a href="/news/<?php 
    echo $articles[0]['article_type'] . '/' . $articles[0]['id'];
    ?>
">latest <?php 
    echo $section;
    ?>
</a>
		</div>
		<?php 
    foreach ($articles as $article) {
        ?>
		<div>
			<a href="/news/<?php 
        echo xml_escape($article['article_type'] . '/' . $article['id']);
        ?>
">
				<img src="/photos/small/<?php 
        echo xml_escape($article['photo_id']);
        ?>
" alt="<?php 
        echo xml_escape($article['photo_title']);
        ?>
" title="<?php 
        echo xml_escape($article['photo_title']);
        ?>
" />
				<?php 
        echo xml_escape($article['heading']);
        ?>
			</a>
			<div class="Date"><?php 
        echo xml_escape($article['date']);
        ?>
</div>
			<div class="clear"></div>
		</div>
		<?php 
    }
    ?>
	</div>
	<?php 
    if ($last) {
        ?>
<div class="clear"></div><?php 
    }
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:59,代码来源:lifestyle.php


示例11: __construct

 /**
  * @param $Keys array with keys 'userid', 'occid'.
  */
 function __construct($Keys, $Extra = NULL)
 {
     parent::__construct(self::$notTypeInfo, $Keys);
     if (NULL !== $Extra) {
         $CI =& get_instance();
         $this->SetData('Custom', '<p>Summary: <strong><a href="' . site_url($Extra['link']) . $CI->uri->uri_string() . '">' . xml_escape($Extra['name']) . '</a></strong>');
     }
 }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:11,代码来源:Calendar_notifications.php


示例12: PrintTextArea

function PrintTextArea($input_name, $item, $sessionvar)
{
    echo '<label for="' . $input_name . '">' . $item . '</label>';
    echo '<textarea name="' . $input_name . '" id="' . $input_name . '" cols="25" rows="5">';
    if (isset($_SESSION[$sessionvar][$input_name])) {
        echo xml_escape($_SESSION[$sessionvar][$input_name]);
    }
    echo '</textarea>';
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:9,代码来源:organisation.php


示例13: ListExperiments

function ListExperiments(&$list, &$query)
{
    global $item_tag;
    global $item_title;
    foreach ($list as $eid => $exp) {
        $exp_name = xml_escape($exp["name"]);
        $equery = $query . "__" . $exp['start'] . "-" . $exp['stop'];
        $res .= "<{$item_tag} {$item_title}=\"{$exp_name}\" id=\"SetQuery__{$equery}\"/>";
    }
    return $res;
}
开发者ID:nicolaisi,项目名称:adei,代码行数:11,代码来源:menu.php


示例14: PrintRequestList

function PrintRequestList($data, $AssignedColumn = FALSE)
{
    $colCount = 5;
    $colCount = floor(100 / $colCount);
    echo '		<div class="ArticleBox">' . "\n";
    echo '			<table>' . "\n";
    echo '			    <thead>' . "\n";
    echo '			        <tr>' . "\n";
    echo '				        <th style="width:' . $colCount . '%;">Request Title</th>' . "\n";
    echo '				        <th style="width:' . $colCount . '%;">Photographer</th>' . "\n";
    echo '				        <th style="width:' . $colCount . '%;">Status</th>' . "\n";
    echo '				        <th style="width:' . $colCount . '%;">Submission Date</th>' . "\n";
    echo '				        <th style="width:' . $colCount . '%;text-align:right;">Article Deadline</th>' . "\n";
    echo '	    		    </tr>' . "\n";
    echo '			    </thead>' . "\n";
    echo '	            <tbody>' . "\n";
    $RowStyle = FALSE;
    if (count($data) == 0) {
        echo '						<tr>';
        echo '							<td colspan="0" style="text-align:center; font-style:italic;">No requests in this section...</td>';
        echo '						</tr>';
    } else {
        foreach ($data as $row) {
            echo '					<tr ';
            if ($RowStyle) {
                echo 'class="tr2"';
            }
            echo '>' . "\n";
            echo '						<td><a href="/office/photos/view/' . $row['id'] . '/"><img src="/images/prototype/news/photo-small.gif" alt="Photo Request" title="Photo Request" /> ' . xml_escape($row['title']) . '</a></td>' . "\n";
            echo '						<td>';
            if ($row['user_name'] != '') {
                echo '<img src="/images/prototype/news/person.gif" alt="Photographer" title="Photographer" /> ' . xml_escape($row['user_name']);
            }
            echo '</td>' . "\n";
            echo '						<td>';
            if ($row['user_status'] != '') {
                echo '<img src="/images/prototype/news/' . xml_escape($row['user_status']) . '.gif" alt="' . xml_escape($row['user_status']) . '" title="' . xml_escape($row['user_status']) . '" /> ' . xml_escape($row['user_status']);
            }
            echo '</td>';
            echo '						<td>' . date('d/m/y @ H:i', $row['time']) . '</td>' . "\n";
            echo '						<td style="text-align:right;';
            if (mktime() > $row['deadline']) {
                echo 'color:red;';
            }
            echo '">' . date('d/m/y @ H:i', $row['deadline']) . '</td>' . "\n";
            echo '					</tr>' . "\n";
            $RowStyle = !$RowStyle;
        }
    }
    echo '			    </tbody>' . "\n";
    echo '			</table>' . "\n";
    echo '		</div>' . "\n";
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:53,代码来源:home.php


示例15: EchoTeamFilterOptions

function EchoTeamFilterOptions($team, $prefix = '', $path = '', $indentation = 0)
{
    foreach ($team['subteams'] as $subteam) {
        echo '<option name="team_' . $subteam['id'] . '">' . "\n";
        //echo str_repeat('&nbsp;&nbsp;&nbsp;&nbsp;',$indentation);
        echo xml_escape($prefix . $path . $subteam['name']) . "\n";
        echo '</option>' . "\n";
        if (!empty($subteam['subteams'])) {
            EchoTeamFilterOptions($subteam, $prefix, $path . $subteam['name'] . '/', $indentation + 1);
        }
    }
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:12,代码来源:members_list.php


示例16: RenderMenu

/**
 * Echos the html for the specified menu array.
 * @param $DrawMenu array[menu_item] In the format of @a $Menu.
 */
function RenderMenu($DrawMenu)
{
    echo '<ul>';
    foreach ($DrawMenu as $child) {
        echo '<li>';
        echo '<a href="' . xml_escape($child['link']) . '">' . xml_escape($child['name']) . ' (' . $child['quantity'] . ')</a>';
        if (isset($child['children']) && !empty($child['children'])) {
            echo RenderMenu($child['children']);
        }
        echo '</li>';
    }
    echo '</ul>';
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:17,代码来源:board.php


示例17: print_comment

function print_comment($comment, $comments_per_page)
{
    $page = floor(($comment['article_comment_count'] - 1) / $comments_per_page) * $comments_per_page + 1;
    if ($comment['comment_anonymous']) {
        echo '			<li class="anonymous">' . "\n";
        echo '				<i>Anonymous</i>' . "\n";
    } else {
        echo '			<li>' . "\n";
        echo '				<i>' . xml_escape($comment['user_firstname'] . ' ' . $comment['user_surname']) . '</i>' . "\n";
    }
    echo '				on <a href="/comments/thread/' . $comment['comment_id'] . '">' . xml_escape($comment['heading']) . '</a>' . "\n";
    echo '			</li>' . "\n";
}
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:13,代码来源:comments_latest.php


示例18: recordToDcmesXml

 public function recordToDcmesXml($item)
 {
     $xml = "\n" . '<rdf:Description rdf:about="' . xml_escape(record_url($item, null, true)) . '">';
     // Iterate throught the DCMES.
     foreach ($this->_dcElements as $elementName) {
         if ($text = metadata($item, array('Dublin Core', $elementName), array('all' => true, 'no_escape' => true))) {
             foreach ($text as $k => $v) {
                 if (!empty($v)) {
                     $xml .= "\n" . '<dc:' . strtolower($elementName) . '>' . xml_escape($v) . '</dc:' . strtolower($elementName) . '>';
                 }
             }
         }
     }
     $xml .= "\n" . '</rdf:Description>';
     return $xml;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:16,代码来源:ItemDcmesXml.php


示例19: getImage

 public function getImage($imageID, $type, $extraTags = array(), $extraArguments = array())
 {
     if (is_int($type)) {
         $sql = 'SELECT image_type_codename FROM image_types WHERE image_type_id = ?';
         $codename = $this->db->query($sql, array($type))->first_row()->image_type_codename;
         $data = $this->get($imageID, 'images', $codename);
     } else {
         $data = $this->get($imageID, 'images', $type);
     }
     $tagInner = '';
     $data['alt'] = $data['title'];
     foreach (array_merge($data, $extraTags) as $name => $value) {
         $tagInner .= $name . '="' . xml_escape($value) . '" ';
     }
     return '<img src="/image/' . $type . '/' . $imageID . '" ' . $tagInner . ' />';
 }
开发者ID:TheYorkerArchive,项目名称:codebase-2006-2012,代码行数:16,代码来源:Image.php


示例20: itemToRSS

 protected function itemToRSS($item)
 {
     $entry = array();
     set_current_record('item', $item, true);
     // Title is a CDATA section, so no need for extra escaping.
     $entry['title'] = strip_formatting(metadata($item, array('Dublin Core', 'Title'), array('no_escape' => true)));
     $entry['description'] = $this->buildDescription($item);
     $entry['link'] = xml_escape(record_url($item, null, true));
     $entry['lastUpdate'] = strtotime($item->added);
     //List the first file as an enclosure (only one per RSS feed)
     if (($files = $item->Files) && ($file = current($files))) {
         $entry['enclosure'] = array();
         $fileDownloadUrl = file_display_url($file);
         $enc['url'] = $fileDownloadUrl;
         $enc['type'] = $file->mime_type;
         $enc['length'] = (int) $file->size;
         $entry['enclosure'][] = $enc;
     }
     return $entry;
 }
开发者ID:lchen01,项目名称:STEdwards,代码行数:20,代码来源:ItemRss2.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP xml_get_current_byte_index函数代码示例发布时间:2022-05-23
下一篇:
PHP xml_error_string函数代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap