[ Index ]
 

Code source de Joomla 1.0.13

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/includes/ -> compat.php41x.php (source)

   1  <?php
   2  /**

   3   * PHP 4.1.x Compatibility functions

   4   */
   5  
   6  // no direct access

   7  defined( '_VALID_MOS' ) or die( 'Restricted access' );
   8  
   9  if (!function_exists( 'array_change_key_case' )) {
  10      if (!defined('CASE_LOWER')) {
  11          define('CASE_LOWER', 0);
  12      }
  13      if (!defined('CASE_UPPER')) {
  14          define('CASE_UPPER', 1);
  15      }
  16  	function array_change_key_case( $input, $case=CASE_LOWER ) {
  17          if (!is_array( $input )) {
  18              return false;
  19          }
  20          $array = array();
  21          foreach ($input as $k=>$v) {
  22              if ($case) {
  23                  $array[strtoupper( $k )] = $v;
  24              } else {
  25                  $array[strtolower( $k )] = $v;
  26              }
  27          }
  28          return $array;
  29      }
  30  }
  31  /**

  32   * Add functionanlity of html_entity_decode() to PHP under 4.3

  33   *

  34   * @category    PHP

  35   * @package     PHP_Compat

  36   * @link        http://php.net/function.html_entity_decode

  37   * @since        PHP 4.3

  38   * @require     PHP 4.0.1 

  39   */
  40  if (!function_exists('html_entity_decode')) {
  41  	function html_entity_decode($string)
  42      {
  43             // Replace numeric

  44             $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
  45             $string = preg_replace('~&#([0-9]+);~e', 'chr(\\1)', $string);
  46             
  47             $trans_tbl = get_html_translation_table(HTML_ENTITIES);
  48             $trans_tbl = array_flip($trans_tbl);
  49             return strtr($string, $trans_tbl);
  50      }
  51  }
  52  ?>


Généré le : Wed Nov 21 14:43:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics