[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 583: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/phpbb/session.php on line 639: sizeof(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4516: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3262)
আমাদের প্রযুক্তি • HTML Number থেকে ASCII Character
Page 1 of 1

HTML Number থেকে ASCII Character

Posted: Thu Jun 07, 2012 6:13 pm
by SajjadRobin
1. Netherl&#228nds থেকে Netherländs
2. অন্যান্য HTML character* থেকে আসল character পেতে হলে নিচের পিএইচপি (PHP) Function টি কাজে লাগবে।

Code: Select all

function unhtmlentities($string)
{
    // replace numeric entities
    $string = preg_replace('~&#x([0-9a-f]+);~ei', 'chr(hexdec("\\1"))', $string);
    $string = preg_replace('~&#([0-9]+);~e', 'chr("\\1")', $string);
    // replace literal entities
    $trans_tbl = get_html_translation_table(HTML_ENTITIES);
    $trans_tbl = array_flip($trans_tbl);
    return strtr($string, $trans_tbl);
}
 
$c = unhtmlentities('Netherl&#228nds');
echo $c;
আউটপুটঃ Netherländs
রেফারেন্সhttp://webtutts.com
* HTML character গুলোর লিস্ট আছে এখানে : http://www.petefreitag.com/cheatsheets/ascii-codes/

Re: HTML Number থেকে ASCII Character

Posted: Thu Jun 07, 2012 11:31 pm
by টেট্রাহোস্ট
জানানোর জন্য ধন্যবাদ!