本文整理汇总了PHP中string_html_entities函数的典型用法代码示例。如果您正苦于以下问题:PHP string_html_entities函数的具体用法?PHP string_html_entities怎么用?PHP string_html_entities使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了string_html_entities函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: error_print_stack_trace
function error_print_stack_trace()
{
if (extension_loaded('xdebug')) {
#check for xdebug presence
$t_stack = xdebug_get_function_stack();
# reverse the array in a separate line of code so the
# array_reverse() call doesn't appear in the stack
$t_stack = array_reverse($t_stack);
array_shift($t_stack);
#remove the call to this function from the stack trace
print '<center><table class="width75">';
foreach ($t_stack as $t_frame) {
print '<tr ' . helper_alternate_class() . '>';
print '<td>' . string_html_entities($t_frame['file']) . '</td><td>' . $t_frame['line'] . '</td><td>' . (isset($t_frame['function']) ? $t_frame['function'] : '???') . '</td>';
$t_args = array();
if (isset($t_frame['params'])) {
foreach ($t_frame['params'] as $t_value) {
$t_args[] = error_build_parameter_string($t_value);
}
}
print '<td>( ' . string_html_entities(implode($t_args, ', ')) . ' )</td></tr>';
}
print '</table></center>';
} else {
$t_stack = debug_backtrace();
array_shift($t_stack);
#remove the call to this function from the stack trace
array_shift($t_stack);
#remove the call to the error handler from the stack trace
print '<center><table class="width75">';
print '<tr><th>Filename</th><th>Line</th><th>Function</th><th>Args</th></tr>';
foreach ($t_stack as $t_frame) {
print '<tr ' . helper_alternate_class() . '>';
print '<td>' . string_html_entities($t_frame['file']) . '</td><td>' . (isset($t_frame['line']) ? $t_frame['line'] : '-') . '</td><td>' . $t_frame['function'] . '</td>';
$t_args = array();
if (isset($t_frame['args'])) {
foreach ($t_frame['args'] as $t_value) {
$t_args[] = error_build_parameter_string($t_value);
}
}
print '<td>( ' . string_html_entities(implode($t_args, ', ')) . ' )</td></tr>';
}
print '</table></center>';
}
}
示例2: print_hidden_input
function print_hidden_input($p_field_key, $p_field_val)
{
if (is_array($p_field_val)) {
foreach ($p_field_val as $t_key => $t_value) {
if (is_array($t_value)) {
$t_key = string_html_entities($t_key);
$t_field_key = $p_field_key . '[' . $t_key . ']';
print_hidden_input($t_field_key, $t_value);
} else {
$t_field_key = $p_field_key . '[' . $t_key . ']';
print_hidden_input($t_field_key, $t_value);
}
}
} else {
$t_key = string_html_entities($p_field_key);
$t_val = string_html_entities($p_field_val);
echo "<input type=\"hidden\" name=\"{$t_key}\" value=\"{$t_val}\" />\n";
}
}
示例3: print_filter_custom_field
function print_filter_custom_field($p_field_id)
{
global $t_filter, $t_accessible_custom_fields_names, $t_accessible_custom_fields_types, $t_accessible_custom_fields_values, $t_accessible_custom_fields_ids, $t_select_modifier;
$j = array_search($p_field_id, $t_accessible_custom_fields_ids);
if ($j === null || $j === false) {
# Note: Prior to PHP 4.2.0, array_search() returns NULL on failure instead of FALSE.
?>
<span style="color:red;weight:bold;">
unknown custom filter (custom <?php
$p_field_id;
?>
)
</span>
<?php
} elseif (isset($t_accessible_custom_fields_names[$j])) {
if ($t_accessible_custom_fields_types[$j] == CUSTOM_FIELD_TYPE_DATE) {
print_filter_custom_field_date($j, $p_field_id);
} else {
echo '<select ' . $t_select_modifier . ' name="custom_field_' . $p_field_id . '[]">';
echo '<option value="' . META_FILTER_ANY . '" ';
check_selected($t_filter['custom_fields'][$p_field_id], META_FILTER_ANY);
echo '>[' . lang_get('any') . ']</option>';
# don't show META_FILTER_NONE for enumerated types as it's not possible for them to be blank
if (!in_array($t_accessible_custom_fields_types[$j], array(CUSTOM_FIELD_TYPE_ENUM, CUSTOM_FIELD_TYPE_LIST, CUSTOM_FIELD_TYPE_MULTILIST))) {
echo '<option value="' . META_FILTER_NONE . '" ';
check_selected($t_filter['custom_fields'][$p_field_id], META_FILTER_NONE);
echo '>[' . lang_get('none') . ']</option>';
}
foreach ($t_accessible_custom_fields_values[$j] as $t_item) {
if (strtolower($t_item) !== META_FILTER_ANY && strtolower($t_item) !== META_FILTER_NONE) {
echo '<option value="' . string_html_entities($t_item) . '" ';
if (isset($t_filter['custom_fields'][$p_field_id])) {
check_selected($t_filter['custom_fields'][$p_field_id], $t_item);
}
echo '>' . string_shorten($t_item) . '</option>' . "\n";
}
}
echo '</select>';
}
}
}
示例4: filter_draw_selection_area2
//.........这里部分代码省略.........
<?php
if (ON == config_get('enable_profiles')) {
?>
<td class="small-caption" id="platform_filter_target">
<?php
print_multivalue_field(FILTER_PROPERTY_PLATFORM, $t_filter[FILTER_PROPERTY_PLATFORM]);
?>
</td>
<td class="small-caption" id="os_filter_target">
<?php
print_multivalue_field(FILTER_PROPERTY_OS, $t_filter[FILTER_PROPERTY_OS]);
?>
</td>
<td class="small-caption" id="os_build_filter_target">
<?php
print_multivalue_field(FILTER_PROPERTY_OS_BUILD, $t_filter[FILTER_PROPERTY_OS_BUILD]);
?>
</td>
<?php
} else {
?>
<td colspan="3"> </td>
<?php
}
?>
<td class="small-caption" id="tag_string_filter_target" colspan="5">
<?php
$t_tag_string = $t_filter[FILTER_PROPERTY_TAG_STRING];
if ($t_filter[FILTER_PROPERTY_TAG_SELECT] != 0 && tag_exists($t_filter[FILTER_PROPERTY_TAG_SELECT])) {
$t_tag_string .= is_blank($t_tag_string) ? '' : config_get('tag_separator');
$t_tag_string .= tag_get_field($t_filter[FILTER_PROPERTY_TAG_SELECT], 'name');
}
echo string_html_entities($t_tag_string);
echo '<input type="hidden" name="', FILTER_PROPERTY_TAG_STRING, '" value="', string_attribute($t_tag_string), '" />';
?>
</td>
</tr>
<?php
# get plugin filters
$t_plugin_filters = filter_get_plugin_filters();
$t_plugin_filter_links = array();
$t_plugin_filter_fields = array();
$t_column_count_by_row = array();
$t_row = 0;
foreach ($t_plugin_filters as $t_field_name => $t_filter_object) {
# be sure the colspan is an integer
$t_colspan = (int) $t_filter_object->colspan;
# prevent silliness.
if ($t_colspan < 0) {
$t_colspan = abs($t_colspan);
} else {
if ($t_colspan > $t_filter_cols) {
$t_colspan = $t_filter_cols;
} else {
if ($t_colspan == 0) {
$t_colspan = 1;
}
}
}
# the row may already have elements in it. find out.
$t_columns_available = $t_filter_cols - $t_column_count_by_row[$t_row];
if ($t_columns_available == 0) {
$t_row++;
}
# see if there is room in the current row
示例5: filter_draw_selection_area2
//.........这里部分代码省略.........
<?php
if (ON == config_get('enable_profiles')) {
?>
<td class="small-caption" valign="top" id="platform_filter_target">
<?php
print_multivalue_field(FILTER_PROPERTY_PLATFORM, $t_filter[FILTER_PROPERTY_PLATFORM]);
?>
</td>
<td class="small-caption" valign="top" id="os_filter_target">
<?php
print_multivalue_field(FILTER_PROPERTY_OS, $t_filter[FILTER_PROPERTY_OS]);
?>
</td>
<td class="small-caption" valign="top" id="os_build_filter_target">
<?php
print_multivalue_field(FILTER_PROPERTY_OS_BUILD, $t_filter[FILTER_PROPERTY_OS_BUILD]);
?>
</td>
<?php
} else {
?>
<td colspan="3"> </td>
<?php
}
?>
<td class="small-caption" valign="top" id="tag_string_filter_target" colspan="5">
<?php
$t_tag_string = $t_filter[FILTER_PROPERTY_TAG_STRING];
if ($t_filter[FILTER_PROPERTY_TAG_SELECT] != 0 && tag_exists($t_filter[FILTER_PROPERTY_TAG_SELECT])) {
$t_tag_string .= is_blank($t_tag_string) ? '' : config_get('tag_separator');
$t_tag_string .= tag_get_field($t_filter[FILTER_PROPERTY_TAG_SELECT], 'name');
}
echo string_html_entities($t_tag_string);
echo '<input type="hidden" name="', FILTER_PROPERTY_TAG_STRING, '" value="', string_attribute($t_tag_string), '" />';
?>
</td>
</tr>
<?php
# get plugin filters
$t_plugin_filters = filter_get_plugin_filters();
$t_column = 0;
$t_fields = '';
$t_values = '';
# output a filter form element for each plugin filter
foreach ($t_plugin_filters as $t_field_name => $t_filter_object) {
$t_fields .= '<td class="small-caption" valign="top"> <a href="' . $t_filters_url . string_attribute($t_field_name) . '" id="' . string_attribute($t_field_name) . '_filter">' . string_display_line($t_filter_object->title) . '</a> </td>';
$t_values .= '<td class="small-caption" valign="top" id="' . string_attribute($t_field_name) . '_filter_target"> ';
if (!isset($t_filter[$t_field_name])) {
$t_values .= lang_get('any');
} else {
switch ($t_filter_object->type) {
case FILTER_TYPE_STRING:
case FILTER_TYPE_INT:
if (filter_field_is_any($t_filter[$t_field_name])) {
$t_values .= lang_get('any');
} else {
$t_values .= string_display_line($t_filter[$t_field_name]);
}
$t_values .= '<input type="hidden" name="' . string_attribute($t_field_name) . '" value="' . string_attribute($t_filter[$t_field_name]) . '"/>';
break;
case FILTER_TYPE_BOOLEAN:
$t_values .= string_display_line($t_filter_object->display((bool) $t_filter[$t_field_name]));
$t_values .= '<input type="hidden" name="' . string_attribute($t_field_name) . '" value="' . (bool) $t_filter[$t_field_name] . '"/>';
break;
case FILTER_TYPE_MULTI_STRING: