Welcome to collectivesolver - Programming & Software Q&A with code examples. A website with trusted programming answers. All programs are tested and work.

Contact: aviboots(AT)netvision.net.il

Buy a domain name - Register cheap domain names from $0.99 - Namecheap

Scalable Hosting That Grows With You

Secure & Reliable Web Hosting, Free Domain, Free SSL, 1-Click WordPress Install, Expert 24/7 Support

Semrush - keyword research tool

Boost your online presence with premium web hosting and servers

Disclosure: My content contains affiliate links.

39,885 questions

51,811 answers

573 users

How to get html translation table in PHP

2 Answers

0 votes
echo "<pre>";
var_dump(get_html_translation_table(HTML_ENTITIES, ENT_QUOTES | ENT_HTML5));
echo "</pre>";


/*
run:

array(1511) {
  ["    "]=>
  string(5) "&Tab;"
  ["
"]=>
  string(9) "&NewLine;"
  ["!"]=>
  string(6) "&excl;"
  ["""]=>
  string(6) """
  ["#"]=>
  string(5) "&num;"
  ["$"]=>
  string(8) "&dollar;"
  ["%"]=>
  string(8) "&percnt;"
  ["&"]=>
  string(5) "&"
  ["'"]=>
  string(6) "'"
  ["("]=>
  string(6) "&lpar;"
  [")"]=>
  string(6) "&rpar;"
  ["*"]=>
  string(5) "&ast;"
  ["+"]=>
  string(6) "&plus;"
  [","]=>
  string(7) "&comma;"
  ["."]=>
  string(8) "&period;"
  ["/"]=>
  string(5) "&sol;"
  [":"]=>
  string(7) "&colon;"
  [";"]=>
  string(6) "&semi;"
  ["<"]=>
  string(4) "<"

  ...

*/

 



answered Jun 22, 2016 by avibootz
0 votes
echo "<pre>";
var_dump(get_html_translation_table(HTML_ENTITIES, ENT_NOQUOTES, 'WINDOWS-1252'));
echo "</pre>";


/*
run:

array(124) {
  ["&"]=>
  string(5) "&"
  ["<"]=>
  string(4) "<"
  [">"]=>
  string(4) ">"
  ["€"]=>
  string(6) "€"
  ["‚"]=>
  string(7) "‚"
  ["ƒ"]=>
  string(6) "ƒ"
  ["„"]=>
  string(7) "„"
  ["…"]=>
  string(8) "…"
  ["†"]=>
  string(8) "†"
  ["‡"]=>
  string(8) "‡"
  ["ˆ"]=>
  string(6) "ˆ"
  ["‰"]=>
  string(8) "‰"

  ...


*/

 



answered Jun 22, 2016 by avibootz

Related questions

2 answers 213 views
1 answer 381 views
1 answer 197 views
1 answer 221 views
...