array(), 'i' => array(), 'a' => array('href' => array('minlen' => 3, 'maxlen' => 50), 'title' => array('valueless' => 'n')), 'p' => array('align' => 1, 'dummy' => array('valueless' => 'y')), 'img' => array('src' => 1), # FIXME 'font' => array('size' => array('minval' => 4, 'maxval' => 20)), 'br' => array()); $val = $_POST['val']; if (get_magic_quotes_gpc()) $val = stripslashes($val); # *** PRINT SOME HTML CODE *** ?> kses example: HTML filter

Input

Output

Type something


Only the following HTML elements and attributes are allowed:

$htmlval) { if (!$first) echo ' '; $first = 0; echo "<$htmlkey"; # element foreach ($htmlval as $html2key => $html2val) echo " $html2key="; # attribute echo ">"; } ?>

<a href=> must have a length in the range 3 to 50.
<a title=> must not be valueless.
<p dummy> must be valueless.
<font size=> must have a value in the range 4 to 20.
Only the URL protocols "http" and "https" are allowed.