CPG-Nuke source documentation ⇒ CPG Dragonfly™ CMS
Files - Classes
  includes/cmsinit.inc
includes
properties
functions
htmlprepare

string htmlprepare(string $str, boolean $nl2br, define $spchar, mixed $nohtml)

Converts all ", ', <, > and & to the html HTML entities which are ", ', <, >, &

When the second parameter is set to true it also converts \n to <br />\n

The third allows you to set if all mention characters must be converted (ENT_QUOTES) or keep the quotes as they are (ENT_NOQUOTES) or don't convert single quotes (ENT_COMPAT)

The fourth allows you to strip all (x)html but you may also specify which to keep like '<a><br><b><i><img><li><ol><p><strong><u><ul>'

Arguments

  • $str

    The string to convert

  • $nl2br [optional, default value = false]

    Convert \n

  • $spchar [optional, default value = ENT_QUOTES]

    Convert mentioned HTML special entities using ENT_QUOTES, ENT_NOQUOTES or ENT_COMPAT

  • $nohtml [optional, default value = false]

    specify which tags to keep when the rest gets stripped