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


PHP get_html_translation_table函数代码示例

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


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

示例1: main

 /**
  * Applies action
  *
  * @return  boolean success
  */
 protected function main()
 {
     $var = Nexista_Flow::find($this->params['var']);
     if (is_null($var) or is_array($var)) {
         return false;
     }
     switch (strtoupper($this->params['transtbl'])) {
         case 'HTML_ENTITIES':
             $trans_tbl = get_html_translation_table(HTML_ENTITIES);
             break;
             //for dealing with non xsl safe chars
         //for dealing with non xsl safe chars
         case 'XSL_ENTITIES':
             $trans_tbl = array(' ' => ' ');
             break;
         default:
             $trans_tbl = get_html_translation_table(HTML_ENTITIES);
             break;
     }
     if (!empty($this->params['reverse']) && $this->params['reverse'] === 'true') {
         $trans_tbl = array_flip($trans_tbl);
     }
     //write new data to Flow
     $var->item(0)->nodeValue = strtr($var->item(0)->nodeValue, $trans_tbl);
     return true;
 }
开发者ID:savonix,项目名称:nexista,代码行数:31,代码来源:translate.action.php

示例2: sitemap_image_html_entity

function sitemap_image_html_entity($data)
{
    global $entity_custom_from, $entity_custom_to;
    if (!is_array($entity_custom_from) || !is_array($entity_custom_to)) {
        $array_position = 0;
        foreach (get_html_translation_table(HTML_ENTITIES) as $key => $value) {
            switch ($value) {
                case ' ':
                    break;
                case '>':
                case '<':
                case '"':
                case ''':
                case '&':
                    $entity_custom_from[$array_position] = $key;
                    $entity_custom_to[$array_position] = $value;
                    $array_position++;
                    break;
                default:
                    $entity_custom_from[$array_position] = $value;
                    $entity_custom_to[$array_position] = $key;
                    $array_position++;
            }
        }
    }
    return str_replace($entity_custom_from, $entity_custom_to, $data);
}
开发者ID:pabnna,项目名称:mrweb,代码行数:27,代码来源:feed-sitemap-image.php

示例3: avoidHtmlEntitiesInterpretation

function avoidHtmlEntitiesInterpretation($str)
{
    $trans = get_html_translation_table(HTML_ENTITIES);
    $encoded = strtr($str, $trans);
    #################
    return $encoded;
}
开发者ID:athoncopy,项目名称:athon,代码行数:7,代码来源:utilities.php

示例4: translate_read_form

/** Show the translation for a message you're reading */
function translate_read_form()
{
    global $color, $translate_server;
    global $message, $translate_dir;
    global $translate_show_read;
    global $imapConnection, $wrap_at, $passed_id, $mailbox;
    if (!$translate_show_read) {
        return;
    }
    $translate_dir = 'to';
    $trans_ar = $message->findDisplayEntity(array(), array('text/plain'));
    $body = '';
    if (!empty($trans_ar[0])) {
        for ($i = 0; $i < count($trans_ar); $i++) {
            $body .= formatBody($imapConnection, $message, $color, $wrap_at, $trans_ar[$i], $passed_id, $mailbox, true);
        }
        $hookResults = do_hook('message_body', $body);
        $body = $hookResults[1];
    } else {
        $body = 'Message can\'t be translated';
    }
    $new_body = $body;
    $trans = get_html_translation_table(HTML_ENTITIES);
    $trans[' '] = '&nbsp;';
    $trans = array_flip($trans);
    $new_body = strtr($new_body, $trans);
    $new_body = urldecode($new_body);
    $new_body = strip_tags($new_body);
    /* I really don't like this next part ... */
    $new_body = str_replace('"', "''", $new_body);
    $new_body = strtr($new_body, "\n", ' ');
    $function = 'translate_form_' . $translate_server;
    $function($new_body);
}
开发者ID:jin255ff,项目名称:company_website,代码行数:35,代码来源:setup.php

示例5: unhtmlentities

function unhtmlentities($string)
{
    $trans_tbl = get_html_translation_table(HTML_ENTITIES);
    $trans_tbl = array_flip($trans_tbl);
    $ret = strtr($string, $trans_tbl);
    return preg_replace('/&#(\\d+);/me', "chr('\\1')", $ret);
}
开发者ID:juliogallardo1326,项目名称:proc,代码行数:7,代码来源:knowledgebase-control.php

示例6: trance_HTML_ENTITIES

 private function trance_HTML_ENTITIES($str)
 {
     $trans = get_html_translation_table(HTML_ENTITIES);
     //$encoded = strtr ($str, $trans);
     $trans = array_flip($trans);
     return strtr($str, $trans);
 }
开发者ID:aav8dgogogotw,项目名称:2013q4hmr,代码行数:7,代码来源:Util.class.php

示例7: unhtmlentities

 function unhtmlentities($string)
 {
     // From php.net for < 4.3 compat
     $trans_tbl = get_html_translation_table(HTML_ENTITIES);
     $trans_tbl = array_flip($trans_tbl);
     return strtr($string, $trans_tbl);
 }
开发者ID:bluedanbob,项目名称:wordpress,代码行数:7,代码来源:wordpress.php

示例8: simplepure_filter

function simplepure_filter(&$pData, &$pFilterHash)
{
    // This function is a menagerie of the techniques of the comments listed at
    // http://www.php.net/manual/en/function.strip-tags.php - spiderr
    global $gBitSystem, $gBitUser;
    // convert all HTML entites to catch people trying to sneak stuff by with things like &#123; etc..
    if (function_exists('html_entity_decode')) {
        // quieten this down since it causes an error in PHP4
        // http://bugs.php.net/bug.php?id=25670
        $pData = @html_entity_decode($pData, ENT_COMPAT, 'UTF-8');
    } else {
        $trans_tbl = get_html_translation_table(HTML_ENTITIES);
        $trans_tbl = array_flip($trans_tbl);
        $pData = strtr($pData, $trans_tbl);
    }
    // strip_tags() appears to become nauseated at the site of a <!DOCTYPE> declaration
    $pData = str_replace('<!DOCTYPE', '<DOCTYPE', $pData);
    // Strip all evil tags that remain
    // this comes out of gBitSystem->getConfig() set in Liberty Admin
    $acceptableTags = $gBitSystem->getConfig('approved_html_tags', DEFAULT_ACCEPTABLE_TAGS);
    // Destroy all script code "manually" - strip_tags will leave code inline as plain text
    if (!preg_match('/\\<script\\>/', $acceptableTags)) {
        $pData = preg_replace("/(\\<script)(.*?)(script\\>)/si", '', $pData);
    }
    $pData = strip_tags($pData, $acceptableTags);
    $pData = str_replace("<!--", "&lt;!--", $pData);
    $pData = preg_replace("/(\\<)(.*?)(--\\>)/mi", "" . nl2br("\\2") . "", $pData);
}
开发者ID:kailIII,项目名称:liberty,代码行数:28,代码来源:filter.simplepurifier.php

示例9: html_entity_decode

 function html_entity_decode($str, $quote_style = ENT_COMPAT)
 {
     $trans_tbl = get_html_translation_table(HTML_ENTITIES, ENT_COMPAT);
     $trans_tbl = array_flip($trans_tbl);
     $ret = strtr($str, $trans_tbl);
     return preg_replace('/&#(\\d+);/me', "chr('\\1')", $ret);
 }
开发者ID:poinine,项目名称:jallin,代码行数:7,代码来源:default.php

示例10: fromNode

 function fromNode($node)
 {
     parent::fromNode($node);
     static $trans = false;
     if (!$trans) {
         $trans = array_flip(get_html_translation_table(HTML_ENTITIES));
     }
     if (@$this->content) {
         if (strpos($this->content, '&') !== false) {
             $this->content = strtr($this->content, $trans);
             $this->content = str_replace('&apos;', "'", $this->content);
         }
         if (false === strpos($this->content, '{')) {
             return;
         }
         preg_match_all('/\\{([a-z_]+(\\(\\))?)\\}/i', $this->content, $matches);
         //if (false !== strpos($this->content,'(')) {
         //    echo "<PRE>";print_R($matches);
         //    exit;
         //}
         $this->args = $matches[1];
         foreach ($this->args as $v) {
             $this->content = str_replace('{' . $v . '}', '%s', $this->content);
         }
         //$this->content = preg_replace('/\{('.implode('|',$matches[1]).')\}/','%s',$this->content);
     }
 }
开发者ID:rohmad-st,项目名称:fpdf,代码行数:27,代码来源:Tspan.php

示例11: unhtmlentities

 function unhtmlentities($string)
 {
     $trans_tbl = get_html_translation_table(HTML_ENTITIES, ENT_QUOTES);
     $trans_tbl = array_flip($trans_tbl);
     $trans_tbl += array('&apos;' => "'");
     return strtr($string, $trans_tbl);
 }
开发者ID:rrecurse,项目名称:IntenseCart,代码行数:7,代码来源:feed2html.php

示例12: pdf_first_clean

function pdf_first_clean($texte){
	// Cette focntion est appelé après la fonction propre
	// $texte = ereg_replace("<p class[^>]*>", "<P>", $texte);
	//Translation des codes iso
	// PB avec l'utilisation de <code>
	$trans = get_html_translation_table(HTML_ENTITIES);
	$texte = preg_replace(',<!-- .* -->,msU', '', $texte); // supprimer les remarques HTML (du Couteau Suisse ?)
	$trans = array_flip($trans);
	$trans["<br />\n"] = "<BR>";        // Pour éviter que le \n ne se tranforme en espace dans les <DIV class=spip_code> (TT, tag SPIP : code)
	$trans['&#176;'] = "°";
	$trans["&#339;"] = "oe";
	$trans["&#8206;"] = "";
	$trans["&#8211;"] = "-";
	$trans["&#8216;"] = "'";
	$trans["&#8217;"] = "'";
	$trans["&#8220;"] = "\"";
	$trans["&#8221;"] = "\"";
	$trans["&#8230;"] = "...";
	$trans["&#8364;"] = "Euros";
	$trans["&ucirc;"] = "û";
	$trans['->'] = '-»';
	$trans['<-'] = '«-';
	$trans['&nbsp;'] = ' ';
	// certains titles font paniquer l'analyse
	$texte = preg_replace(',title=".*",msU', 'title=""', $texte);
	
	$texte = unicode2charset(charset2unicode($texte), 'iso-8859-1'); // repasser tout dans un charset acceptable par export PDF
	$texte = strtr($texte, $trans);

	return $texte;
}
开发者ID:samszo,项目名称:open-edition,代码行数:31,代码来源:article_pdf_mes_fonctions.php

示例13: unhtmlentities

function unhtmlentities($string) {
	$trans_tbl = get_html_translation_table(HTML_ENTITIES);
	$trans_tbl = array_flip($trans_tbl);
	$ret = strtr($string, $trans_tbl);

//	return preg_replace('/&#(\d+);/me', "chr('\\1')", $ret);
	return preg_replace_callback('/&#(\d+);/m', function ($coincidencias) {return strtolower($coincidencias[0]);}, $ret);
}
开发者ID:javierlov,项目名称:FuentesWeb,代码行数:8,代码来源:string_utils.php

示例14: specialchars

 /**
  * Acts like htmlspecialchars but skips characters from $exclude
  */
 public static function specialchars($html, $exclude = array('"', "'", "<", ">", "&", " "))
 {
     $list = get_html_translation_table(HTML_ENTITIES);
     foreach ($exclude as $character) {
         unset($list[$character]);
     }
     return strtr($html, $list);
 }
开发者ID:hielsnoppe,项目名称:php-goodies,代码行数:11,代码来源:Util.php

示例15: decode

 public function decode($string)
 {
     $entities = get_html_translation_table(HTML_ENTITIES, ENT_NOQUOTES, 'UTF-8');
     $specialChars = get_html_translation_table(HTML_SPECIALCHARS, ENT_NOQUOTES, 'UTF-8');
     $latinChars["latinChars"] = array_diff($entities, $specialChars);
     $decodeString = strtr($string, $latinChars["latinChars"]);
     return $decodeString;
 }
开发者ID:argosback,项目名称:statistical-log-analizer,代码行数:8,代码来源:HtmlDecoder.php


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