nxs_decodeEntities

The NextScripts: Social Networks Auto-Poster nxs decodeEntities function.

Description

nxs_decodeEntities( $text ); 

Parameters (1)

0. $text
The text.

Usage

  1. if ( !function_exists( 'nxs_decodeEntities' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'nextscripts-social-networks-auto-poster/nxs_functions.php'; 
  3.  
  4. // The text. 
  5. $text = null; 
  6.  
  7. // NOTICE! Understand what this does before running. 
  8. $result = nxs_decodeEntities($text); 
  9.  

Defined (1)

The function is defined in the following location(s).

/nxs_functions.php  
  1. if (!function_exists('nxs_decodeEntities')) {function nxs_decodeEntities($text) { 
  2. $text= html_entity_decode($text, ENT_QUOTES, "ISO-8859-1"); #NOTE: UTF-8 does not work! 
  3. $text= preg_replace('/&#(\d+);/me', "chr(\\1)", $text); #decimal notation 
  4. $text= preg_replace('/&#x([a-f0-9]+);/mei', "chr(0x\\1)", $text); #hex notation 
  5. return $text; 
  6. }}