GENWiki

Premier IT Outsourcing and Support Services within the UK

User Tools

Site Tools


php:escape_a_string_for_display_in_a_webpage
function escapeTxtInCodeTag($txt) {
 $callback = function($matches) {
    return '<code' . $matches[1] . '>' . htmlentities($matches[2], ENT_QUOTES, 'UTF-8') . '

'; }; $txt = preg_replace_callback('#\<\s*code(.*?)>(.+?)<\s*\/code\s*>#', $callback, $txt); return $txt; } </code>

/data/webs/external/dokuwiki/data/pages/php/escape_a_string_for_display_in_a_webpage.txt · Last modified: 2019/05/20 10:17 by genadmin

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki