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

PHP html_entities函数代码示例

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

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



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

示例1: channel_select

/**
 * Prints a <select> of the available channels
/**/
function channel_select($params = '', $selected = '', $id = 00)
{
    $channels = Channel::getChannelList();
    echo "\n<select name=\"chan_{$id}\" {$params}>";
    foreach ($channels as $chanid) {
        $channel =& Channel::find($chanid);
        // Not visible?
        if (empty($channel->visible) || $channel->chanid == 91010) {
            continue;
        }
        // Print the option
        echo '
                <option value="', $channel->chanid, '"', ' title="', html_entities($channel->name), '"';
        // Selected?
        if ($channel->chanid == $selected || $channel->chanid == $_GET['chanid']) {
            echo ' SELECTED';
        }
        // Print the rest of the content
        echo '>';
        if ($_SESSION["prefer_channum"]) {
            echo $channel->channum . '&nbsp;&nbsp;(' . html_entities($channel->callsign) . ')';
        } else {
            echo html_entities($channel->callsign) . '&nbsp;&nbsp;(' . $channel->channum . ')';
        }
        echo '</option>';
    }
    echo '</select>';
}
开发者ID:AndrewMoore10,项目名称:MythWebKGTV,代码行数:31,代码来源:quad.php


示例2: input_select

/**
 * Prints a <select> of the available recording inputs
 **/
function input_select($selected, $ename = 'prefinput')
{
    static $inputs;
    // Gather the data
    if (empty($inputs)) {
        global $db;
        $sh = $db->query('SELECT cardid,
                                     IF(LENGTH(IFNULL(displayname,"")) > 0,
                                        displayname,
                                        CONCAT(cardid, ":", inputname)
                                       ) AS name
                                FROM capturecard
                            ORDER BY name');
        while (list($id, $name) = $sh->fetch_row()) {
            $inputs[$id] = $name;
        }
        $sh->finish();
    }
    // Only one input?
    if (count($inputs) == 1) {
        list($id, $name) = reset($inputs);
        echo '<input type="hidden" name="', $ename, '" value="0">', t('Any');
    } else {
        echo '<select name="', $ename, '">', '<option value="0">', t('Any'), '</option>';
        foreach ($inputs as $id => $name) {
            echo '<option value="', $id, '"';
            if ($selected && $id == $selected) {
                echo ' SELECTED';
            }
            echo '>', html_entities($name), '</option>';
        }
        echo '</select>';
    }
}
开发者ID:knowledgejunkie,项目名称:mythweb,代码行数:37,代码来源:schedule_utils.php


示例3: _generate_email_markup

 function _generate_email_markup($contents)
 {
     $return = '';
     foreach ($contents as $content) {
         if (isset($content['tag'])) {
             $return .= '<' . $content['tag'];
         }
         if (isset($content['css'])) {
             $return .= ' style="' . htmlentities($content['css']) . '"';
         }
         if (isset($content['tag'])) {
             $return .= '>';
         }
         foreach ($content as $i => $c) {
             if ($i != 'tag' && $i != 'css') {
                 if (is_array($c)) {
                     $return .= _generate_email_markup($c);
                 } else {
                     $return .= auto_link(html_entities($c));
                 }
             }
         }
         if (isset($content['tag'])) {
             $return .= '</' . $content['tag'] . '>';
         }
     }
     return $return;
 }
开发者ID:inexor-game-obsolete,项目名称:project-site,代码行数:28,代码来源:mail.php


示例4: getOptionEvent2

function getOptionEvent2()
{
    extract(html_entities($_POST));
    $q = mysql_query("SELECT * FROM event WHERE `status`='" . $status . "' ORDER BY kode DESC");
    while ($r = mysql_fetch_array($q)) {
        echo '<option value="' . $r['id'] . '">' . $r['kode'] . ' - ' . $r['nama'] . '</option>';
    }
}
开发者ID:buruhsd,项目名称:customize-t-shirt,代码行数:8,代码来源:ajax.php


示例5: html_encode

function html_encode($str, $skip_html_tag_characters = false)
{
    if (!$skip_html_tag_characters) {
        return strtr($str, html_entities());
    }
    $entities = html_entities();
    unset($entities['<'], $entities['>'], $entities['"'], $entities["/"]);
    return strtr($str, $entities);
}
开发者ID:nosnebilla,项目名称:default-hub,代码行数:9,代码来源:html_helpers.php


示例6: html_entities

function html_entities($str)
{
    if (is_array($str)) {
        foreach ($str as $key => $val) {
            $str[$key] = html_entities($val);
        }
    } else {
        $str = htmlentities($str, ENT_QUOTES | ENT_IGNORE, "UTF-8");
    }
    return $str;
}
开发者ID:buruhsd,项目名称:customize-t-shirt,代码行数:11,代码来源:function.php


示例7: language_select

/**
 * Displays a <select> of the available languages
/**/
function language_select()
{
    echo '<select name="language">';
    foreach (Translate::$Languages as $lang => $details) {
        // Print the option
        echo '<option value="' . html_entities($lang) . '"';
        if ($_SESSION['language'] == $lang) {
            echo ' SELECTED';
        }
        echo '>' . $details[0] . '</option>';
    }
    echo '</select>';
}
开发者ID:halovanic,项目名称:mythweb,代码行数:16,代码来源:set_session.php


示例8: postMarkup

 public function postMarkup($text = null)
 {
     if ($text == null) {
         return false;
     }
     $text = html_entities($text);
     $text = preg_replace('/\\[([a-zA-Z0-9\\/\\.\\-_:\\?,\\=\\s]+)\\]\\((ftp:\\/\\/|irc:\\/\\/|ircs:\\/\\/|http:\\/\\/|https:\\/\\/)([a-zA-Z0-9\\/\\.\\-_:\\?,\\=]+)\\)/i', '<a href="$2$3" target=_new>$1</a>', $text);
     $text = preg_replace('/\\*\\*([a-zA-Z0-9\\/\\.\\-_:\\?,\\=\\s\\)\\(\\*\\&\\^\\!\\@\\#\\$\\%\\^\\+\\=\\`\\~\\{\\}\\[\\]]+)\\*\\*/i', '<strong>$1</strong>', $text);
     $text = preg_replace('/\\-\\-([a-zA-Z0-9\\/\\.\\-_:\\?,\\=\\s\\)\\(\\*\\&\\^\\!\\@\\#\\$\\%\\^\\+\\=\\`\\~\\{\\}\\[\\]]+)\\-\\-/i', '<del>$1</del>', $text);
     $text = preg_replace('/\\`([a-zA-Z0-9\\/\\.\\-_:\\?,\\=\\s\\)\\(\\*\\&\\^\\!\\@\\#\\$\\%\\^\\+\\=\\`\\~\\{\\}\\[\\]]+)\\`/i', '<code>$1</code>', $text);
     $text = preg_replace('/\\~\\~([a-zA-Z0-9\\/\\.\\-_:\\?,\\=\\s\\)\\(\\*\\&\\^\\!\\@\\#\\$\\%\\^\\+\\=\\`\\~\\{\\}\\[\\]]+)\\~\\~/i', '<em>$1<\\em>', $text);
     $text = preg_replace('/\\_\\_([a-zA-Z0-9\\/\\.\\-_:\\?,\\=\\s\\)\\(\\*\\&\\^\\!\\@\\#\\$\\%\\^\\+\\=\\`\\~\\{\\}\\[\\]]+)\\_\\_/i', '<u>$1</u>', $text);
     return $text;
 }
开发者ID:xnite,项目名称:simple-markup,代码行数:14,代码来源:simpleMarkup.php


示例9: host_choices

/**
 * Prints out the host choices for this section.
 **/
function host_choices()
{
    global $Settings_Hosts;
    if (is_array($Settings_Hosts)) {
        $s = '<form id="host_form" name="host_form" action="' . form_action . '" method="post">' . '<select name="settings_host" onchange="$(\'host_form\').submit()">';
        foreach ($Settings_Hosts as $host => $name) {
            $s .= '<option value="' . html_entities($host) . '"';
            if ($host == $_SESSION['settings']['host']) {
                $s .= ' SELECTED';
            }
            $s .= '>' . html_entities($name) . '</option>';
        }
        $s .= '<noscript><input type="submit" value="' . t('Set Host') . '"></noscript>';
        return $s . '</form>';
    } else {
        return $Settings_Hosts;
    }
}
开发者ID:knowledgejunkie,项目名称:mythweb,代码行数:21,代码来源:handler.php


示例10: shop_url

/**
 * phpwcms content management system
 *
 * @author Oliver Georgi <[email protected]>
 * @copyright Copyright (c) 2002-2015, Oliver Georgi
 * @license http://opensource.org/licenses/GPL-2.0 GNU GPL-2
 * @link http://www.phpwcms.de
 *
 **/
function shop_url($get = '', $type = 'htmlentities')
{
    $base = MODULE_HREF;
    if (is_array($get) && count($get)) {
        $get = implode('&', $get);
    } elseif (empty($get)) {
        $get = '';
    }
    if ($get) {
        $get = '&' . $get;
    }
    if (empty($type) || $type != 'htmlentities') {
        $base = str_replace('&amp;', '&', MODULE_HREF);
    } else {
        $get = html_entities($get);
    }
    return $base . $get;
}
开发者ID:Ideenkarosell,项目名称:phpwcms,代码行数:27,代码来源:functions.backend.inc.php


示例11: display_errors

function display_errors($leading = '<p align="center">', $trailing = '</p>')
{
    global $Errors, $Warnings;
    // Errors or warnings from a previous page?
    if (@count($_SESSION['WARNINGS'])) {
        foreach ($_SESSION['WARNINGS'] as $warning) {
            $Warnings[] = $warning;
        }
        unset($_SESSION['WARNINGS']);
    }
    // Nothing to show?
    if (empty($Errors) && empty($Warnings)) {
        return;
    }
    // Load the errors
    $js_errstr = implode("\n", array_merge($Errors, $Warnings));
    $errstr = str_replace("\n", "<br />\n", html_entities($js_errstr));
    // Clean up the javascript error string
    $js_errstr = str_replace("\n", "\\n", str_replace('"', '\\"', $js_errstr));
    // Print
    echo <<<EOF
<script language="JavaScript" type="text/javascript">
<!--
on_load.push(display_errors);
function display_errors() { alert("{$js_errstr}"); };
// -->
</script>
<noscript>
{$leading}
<div id="error">
{$errstr}
</div>
{$trailing}
</noscript>
EOF;
}
开发者ID:Beirdo,项目名称:beirdobot,代码行数:36,代码来源:errordisplay.php


示例12: t

:</h3>
            <dl class="clearfix">
               <dt><?php 
echo t('Find Day');
?>
:</dt>
               <dd><?php 
day_select($schedule->findday);
?>
</dd>
               <dt><?php 
echo t('Find Time');
?>
:</dt>
               <dd><input type="text" name="findtime" value="<?php 
echo html_entities($schedule->findtime);
?>
" /></dd>
            </dl>
        </div>

        <div class="x-options">
<?php 
require_once tmpl_dir . '_advanced_options.php';
?>
        </div>

        <div id="schedule_submit">
            <input type="submit" class="submit" name="save" value="<?php 
echo $schedule->recordid ? t('Save Schedule') : t('Create Schedule');
?>
开发者ID:AndrewMoore10,项目名称:MythWebKGTV,代码行数:31,代码来源:schedules_custom.php


示例13: is_checked

is_checked('1', $plugin['data']['shop_pref_terms_format']);
?>
 onchange="enableSubmit();" /></td>
				<td class="f10"><label for="pref_terms_html">HTML</label>&nbsp;</td>
			</tr>
		</table></td>

	</tr>

	<tr>
		<td align="right" class="chatlist tdtop5"><?php 
echo $BLM['shopprod_terms'];
?>
:&nbsp;</td>
		<td><textarea name="pref_terms" id="pref_terms" class="v12 width375" onchange="enableSubmit();" rows="10"><?php 
echo $plugin['data']['shop_pref_terms_format'] ? html_entities($plugin['data']['shop_pref_terms']) : html_specialchars($plugin['data']['shop_pref_terms']);
?>
</textarea></td>
	</tr>

<tr><td colspan="2"><img src="img/leer.gif" alt="" width="1" height="10" /></td></tr>

	<tr>
		<td align="right" class="chatlist tdtop3"><?php 
echo $BLM['shopprod_api'];
?>
:&nbsp;</td>
		<td><table summary="" cellpadding="0" cellspacing="0" border="0">
			<tr>
				<td><input type="checkbox" name="pref_api_access" id="pref_api_access" value="1"<?php 
is_checked('1', $plugin['data']['shop_pref_api_access']);
开发者ID:Ideenkarosell,项目名称:phpwcms,代码行数:31,代码来源:edit.preferences.inc.php


示例14: die

<?php

if (!defined('BASEPATH')) {
    die('You are not allowed to access this page');
}
if ($_SESSION['member'] == true) {
    //if session member
    if ($_POST['submit']) {
        extract(html_entities($_POST));
        $nominal = str_replace(",", "", $nominal);
        $picture = "";
        $files = $_FILES['upload']['name'];
        if ($files != "") {
            $source = $_FILES['upload']['tmp_name'];
            $ext = end(explode(".", $files));
            $picture = "asset/upload/" . md5(time()) . "." . $ext;
            move_uploaded_file($source, $picture);
        }
        $total = str_replace(",", "", $total);
        $Qry = "INSERT INTO konfirmasi (order_id, member_id, bank_id, nominal, \n\t\t\ttgl_transfer, nama_akun, no_rekening, nama_bank, gambar, `status`) VALUES \n\t\t\t('" . $order_id . "', '" . $_SESSION['id'] . "', '" . $bank_id . "', \n\t\t\t'" . $nominal . "', '" . $tgl_transfer . "', '" . $nama_akun . "', \n\t\t\t'" . $no_rekening . "', '" . $nama_bank . "', '" . $picture . "', '1')";
        $Res = mysql_query($Qry);
        if ($Res) {
            $message = "<div class='success'>Berhasil mengirim konfirmasi pembayaran..</div>";
        } else {
            $message = "<div class='error'>" . mysql_error() . "</div>";
        }
        $_SESSION['msg'] = $message;
        header("Location: index.php?p=confirmpayment");
    }
    ?>
开发者ID:buruhsd,项目名称:customize-t-shirt,代码行数:30,代码来源:confirmpayment.php


示例15: details_list

 /**
  * The "details list" for each program.
  **/
 public function details_list()
 {
     // Start the list, and print the show airtime and title
     $str = "<dl class=\"details_list\">\n" . "\t<dt>" . t('Airtime') . ":</dt>\n" . "\t<dd>" . t('$1 to $2', strftime($_SESSION['time_format'], $this->starttime), strftime($_SESSION['time_format'], $this->endtime)) . "</dd>\n" . "\t<dt>" . t('Channel') . ":</dt>\n" . "\t<dd>" . ($_SESSION["prefer_channum"] ? $this->channel->channum : $this->channel->callsign) . ' - ' . $this->channel->name . "</dd>\n" . "\t<dt>" . t('Title') . ":</dt>\n" . "\t<dd>" . html_entities($this->title) . "</dd>\n";
     // Subtitle
     if (preg_match('/\\S/', $this->subtitle)) {
         $str .= "\t<dt>" . t('Subtitle') . ":</dt>\n" . "\t<dd>" . html_entities($this->subtitle) . "</dd>\n";
     }
     // Description
     if (preg_match('/\\S/', $this->fancy_description)) {
         $str .= "\t<dt>" . t('Description') . ":</dt>\n" . "\t<dd>" . nl2br(html_entities($this->fancy_description)) . "</dd>\n";
     }
     // Original Airdate
     if (!empty($this->airdate)) {
         $str .= "\t<dt>" . t('Original Airdate') . ":</dt>\n" . "\t<dd>" . html_entities($this->airdate) . "</dd>\n";
     }
     // Category
     if (preg_match('/\\S/', $this->category)) {
         $str .= "\t<dt>" . t('Category') . ":</dt>\n" . "\t<dd>" . html_entities($this->category) . "</dd>\n";
     }
     // Will be recorded at some point in the future?
     if (!empty($this->will_record)) {
         $str .= "\t<dt>" . t('Schedule') . ":</dt>\n" . "\t<dd>";
         switch ($this->rectype) {
             case rectype_once:
                 $str .= t('rectype-long: once');
                 break;
             case rectype_daily:
                 $str .= t('rectype-long: daily');
                 break;
             case rectype_always:
                 $str .= t('rectype-long: always');
                 break;
             case rectype_weekly:
                 $str .= t('rectype-long: weekly');
                 break;
             case rectype_findone:
                 $str .= t('rectype-long: findone');
                 break;
             case rectype_override:
                 $str .= t('rectype-long: override');
                 break;
             case rectype_dontrec:
                 $str .= t('rectype-long: dontrec');
                 break;
             default:
                 $str .= t('Unknown');
         }
         $str .= "</dd>\n";
     }
     // Recording Priority
     if ($this->recpriority != null) {
         $str .= "\t<dt>" . t('Recording Priority') . "</dt><dd>" . $this->recpriority . "</dd>\n";
     } elseif ($this->recpriority2 != null) {
         $str .= "\t<dt>" . t('Recording Priority') . "</dt><dd>" . $this->recpriority2 . "</dd>\n";
     }
     // Recording status
     if (!empty($this->recstatus)) {
         $str .= "\t<dt>" . t('Notes') . ":</dt>\n" . "\t<dd>" . $GLOBALS['RecStatus_Reasons'][$this->recstatus] . "</dd>\n";
     }
     // Finish off the table and return
     $str .= "\n</dl>";
     return $str;
 }
开发者ID:knowledgejunkie,项目名称:mythweb,代码行数:67,代码来源:Program.php


示例16: foreach

        foreach ($program->jobs_possible as $id => $job) {
            echo '                <li>', '<a href="', root_url, 'tv/detail/', $program->chanid, '/', $program->recstartts, '?job=', $id, '">', $job, "</a></li>";
        }
        echo '            </ul>';
    }
    if (count($program->jobs['queue'])) {
        echo t('Queued jobs'), ':', '            <ul class="-queued">';
        foreach ($program->jobs['queue'] as $job) {
            echo '                <li>', $Jobs[$job['type']], ' (', $Job_Status[$job['status']], ':  ', strftime($_SESSION['date_listing_key'], $job['statustime']), ')<br>', html_entities($job['comment']), '</li>';
        }
        echo '            </ul>';
    }
    if (count($program->jobs['done'])) {
        echo t('Recently completed jobs'), ':', '            <ul class="-done">';
        foreach ($program->jobs['done'] as $job) {
            echo '                <li>', $Jobs[$job['type']], ' (', $Job_Status[$job['status']], ':  ', strftime($_SESSION['date_listing_key'], $job['statustime']), ')<br>', html_entities($job['comment']), '</li>';
        }
        echo '            </ul>';
    }
    ?>
            </div>

        <?php 
    flush();
    $frontends = MythFrontend::findFrontends();
    if (is_array($frontends)) {
        echo '<div class="x-frontends">' . t('Play Recording on Frontend') . ':<ul>';
        foreach ($frontends as $frontend) {
            echo '<li><a onclick="watchShow(\'' . urlencode($frontend->getHost()) . '\', \'' . urlencode($program->chanid) . '\', \'' . urlencode($program->recstartts) . '\');">' . $frontend->getHost() . '</a><br>';
        }
        echo '</ul></div>';
开发者ID:antonyraj15411,项目名称:mythweb,代码行数:31,代码来源:detail.php


示例17: count

       <td colspan="5" rowspan="<?php 
        echo count($shows) - $i;
        ?>
"></td>
      <?php 
    }
    ?>
       <td class="center" style="font-weight: bold;"><?php 
    echo $i + 1;
    ?>
</td>
      <?php 
    if (isset($channels[$i])) {
        ?>
       <td><?php 
        echo html_entities($channels[$i]['name']);
        ?>
</td>
       <td class="center"><?php 
        echo $channels[$i]['recorded'];
        ?>
</td>
       <td><?php 
        echo date('F j Y', $channels[$i]['last_recorded']);
        ?>
</td>
      <?php 
    } elseif ($padded == false) {
        $padded = true;
        ?>
       <td colspan="5" rowspan="<?php 
开发者ID:halovanic,项目名称:mythweb,代码行数:31,代码来源:stats.php


示例18: t

</tr><tr>
    <th><?php 
echo t('Listing &quot;Jump to&quot;');
?>
&nbsp;</td>
    <td><input type="text" size="24" name="date_listing_jump" value="<?php 
echo html_entities($_SESSION['date_listing_jump']);
?>
"></td>
</tr><tr>
    <th><?php 
echo t('Channel &quot;Jump to&quot;');
?>
&nbsp;</td>
    <td><input type="text" size="24" name="date_channel_jump" value="<?php 
echo html_entities($_SESSION['date_channel_jump']);
?>
"></td>
</tr><tr class="x-sep">
    <th><?php 
echo t('Hour Format');
?>
&nbsp;</td>
    <td><select name="time_format" style="text-align: center"><?php 
foreach (array('%I:%M %p', '%H:%M') as $code) {
    echo "<option value=\"{$code}\"";
    if ($_SESSION['time_format'] == $code) {
        echo ' SELECTED';
    }
    echo '>' . strftime($code, strtotime('9:00 AM')) . ' / ' . strftime($code, strtotime('9:00 PM')) . '</option>';
}
开发者ID:AndrewMoore10,项目名称:MythWebKGTV,代码行数:31,代码来源:set_session.php


示例19: getQueryString_htmlentities

function getQueryString_htmlentities($key = '', $value = '', $bind = '=')
{
    if ($value !== '') {
        return html_entities(urlencode($key) . $bind . str_replace('%2C', ',', urlencode($value)));
    } elseif (PHPWCMS_ALIAS_WSLASH) {
        return html_entities(str_replace('%2F', '/', urlencode($key)));
    }
    return html_entities(urlencode($key));
}
开发者ID:EDVLanger,项目名称:phpwcms,代码行数:9,代码来源:default.inc.php


示例20: html_entities

?>
:</dt>
                <dd><input type="text" class="quantity" name="startoffset" value="<?php 
echo html_entities($schedule->startoffset);
?>
">
                    <?php 
echo t('minutes');
?>
</dd>
                <dt><?php 
echo t('End Late');
?>
:</dt>
                <dd><input type="text" class="quantity" name="endoffset" value="<?php 
echo html_entities($schedule->endoffset);
?>
">
                    <?php 
echo t('minutes');
?>
</dd>
                </fieldset>
            </dl>

<div style="display: none;" id="message-dialog">
   <div id="metadata-message"></div>
   <div class="commands">
     <a onclick="Dialogs.close(); return false;"><?php 
echo t('OK');
?>
开发者ID:AndrewMoore10,项目名称:MythWebKGTV,代码行数:31,代码来源:_advanced_options.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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