Topic: Tip: Simpler $config
$config parameters that use the same value as the htmLawed default need not be specified. E.g., there is no point specifying 'elements' and 'balance' in the code below since the values are the same as the default ones
$str = htmLawed($str, array('safe'=>1, elements=>'*+embed', 'balance'=>1, 'valid_xhtml'=>1));
Thus, above can simply be
$str = htmLawed($str, array('safe'=>1, 'valid_xhtml'=>1));
Similarly, instead of the code below...
$LawedConfigGold = array
(
'safe' => 1,
'deny_attribute' => 'on*, style',
'cdata'=> 0
);
...one can use
$LawedConfigGold = array
(
'safe' => 1,
'deny_attribute' => 'style',
);
In the example above, the 'safe' parameter is a 'magic' one that auto-sets some of the htmLawed default values (making 'cdata' 0 instead of 3, for instance).
The default values (and how they are affected by the magic parameters are noted in the documentation.