escape

1.0 1.1 1.2 1.3

Applies various escaping schemes on the given string

<?php
escape([ $value = "", [ $format = 'html', [ $charset = null ]]])
  • value: the string to process
  • format: escaping format to use, valid formats are : html, htmlall, url, urlpathinfo, quotes, hex, hexentity, javascript and mail
  • charset: character set to use for the conversion (applies to some formats only), defaults to the current Dwoo charset

Available formats

  • html
  • htmlall
  • url
  • urlpathinfo
  • quotes
  • hex
  • hexentity
  • javascript
  • js
  • mail

Examples

Example #1

index.tpl
{"some <strong>html</strong> tags"|escape}

The above example will output:

some &lt;strong&gt;html&lt;/strong&gt; tags

Changelog

Version Description
1.3.2 Add alias js for the javascript format.