TEXT"); Conclusio...">All geek questions in one placePHP - Removing the effect of HTML tags in a string - BUT also displaying them?Consider strip_tags().strip_tags("<b>TEXT</b>"); Conclusion:TEXTBut what if I want to nullify the effect of tags, but showing them?Conclusion:<b> TEXT </b>Should i use preg_replace()? Or is there a more elegant solution?Thanks: D+3html php replace tags stripBojack May 05 '10 at 19:20source share3 answersYou can encode HTML through htmlspecialchars :htmlspecialchars("<b>TEXT</b>"); +10Redfilter May 05 '10 at 19:23source shareHTML, htmlspecialchars htmlentities. , PHP, , , .htmlspecialchars_decode html_entity_decode - , .+4akamike 05 '10 19:24You can always just replace <with <and >with >, yes?+1Chris May 05 '10 at 19:21source shareSource: https://habr.com/ru/post/1744223/More articles:Resize columns in NSOutlineView without displaying headers - objective-cAndroid - getTabHost () - undefined - javaHow to load parent element header in Drupal - phpWhat is the best prctice to use security in JAX-WS - securityWhat is an SQL statement that removes duplicates but retains additional column data? - sqlHow to install Nokogiri as Macrouby Stone? - ruby | fooobar.comGraphical representation in Haskell - graphSQL Server: позиция на основе меток - c#Rails - dynamic addition to sortable_element - prototypejsLLVM: bitcode with llvm-gcc (mingw) for windows - mingwAll Articles
Consider strip_tags().
strip_tags()
strip_tags("<b>TEXT</b>");
Conclusion:
TEXT
But what if I want to nullify the effect of tags, but showing them?
<b> TEXT </b>
Should i use preg_replace()? Or is there a more elegant solution?
preg_replace()
Thanks: D
You can encode HTML through htmlspecialchars :
htmlspecialchars("<b>TEXT</b>");
HTML, htmlspecialchars htmlentities. , PHP, , , .
htmlspecialchars_decode html_entity_decode - , .
You can always just replace <with <and >with >, yes?
<
<
>
>
Source: https://habr.com/ru/post/1744223/More articles:Resize columns in NSOutlineView without displaying headers - objective-cAndroid - getTabHost () - undefined - javaHow to load parent element header in Drupal - phpWhat is the best prctice to use security in JAX-WS - securityWhat is an SQL statement that removes duplicates but retains additional column data? - sqlHow to install Nokogiri as Macrouby Stone? - ruby | fooobar.comGraphical representation in Haskell - graphSQL Server: позиция на основе меток - c#Rails - dynamic addition to sortable_element - prototypejsLLVM: bitcode with llvm-gcc (mingw) for windows - mingwAll Articles