[ Index ]
 

Code source de PRADO 3.0.6

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/framework/Web/ -> THttpUtility.php (source)

   1  <?php
   2  /**
   3   * THttpUtility class file
   4   *
   5   * @author Qiang Xue <qiang.xue@gmail.com>
   6   * @link http://www.pradosoft.com/
   7   * @copyright Copyright &copy; 2005 PradoSoft
   8   * @license http://www.pradosoft.com/license/
   9   * @version $Id: THttpUtility.php 1397 2006-09-07 07:55:53Z wei $
  10   * @package System.Web
  11   */
  12  
  13  /**
  14   * THttpUtility class
  15   *
  16   * @author Qiang Xue <qiang.xue@gmail.com>
  17   * @version $Id: THttpUtility.php 1397 2006-09-07 07:55:53Z wei $
  18   * @package System.Web
  19   * @since 3.0
  20   */
  21  class THttpUtility
  22  {
  23      private static $_encodeTable=array('<'=>'&lt;','>'=>'&gt;','"'=>'&quot;');
  24      private static $_decodeTable=array('&lt;'=>'<','&gt;'=>'>','&quot;'=>'"');
  25  
  26      /**
  27       * HTML-encodes a string.
  28       * This method translates the following characters to their corresponding
  29       * HTML entities: <, >, "
  30       * Note, unlike {@link htmlspeicalchars}, & is not translated.
  31       * @param string string to be encoded
  32       * @return string encoded string
  33       */
  34  	public static function htmlEncode($s)
  35      {
  36          return strtr($s,self::$_encodeTable);
  37      }
  38  
  39      /**
  40       * HTML-decodes a string.
  41       * It is the inverse of {@link htmlEncode}.
  42       * @param string string to be decoded
  43       * @return string decoded string
  44       */
  45  	public static function htmlDecode($s)
  46      {
  47          return strtr($s,self::$_decodeTable);
  48      }
  49  }
  50  
  51  ?>


Généré le : Sun Feb 25 21:07:04 2007 par Balluche grâce à PHPXref 0.7