Codex tools: Log in
Contents |
Will balance the tags if forced to or the option is set to balance tags.
The option 'use_balanceTags' is used for whether the tags will be balanced. Either the $force parameter or 'use_balanceTags' option need to be true before the tags will be balanced.
<?php balanceTags( $text, $force ); ?>
<?php $html = '<ul> <li>this <li>is <li>a <li>list </ul>'; echo balanceTags($html, true); ?>
Will output this HTML:
<ul> <li>this </li><li>is </li><li>a </li><li>list </li></ul>
Since: 0.71
balanceTags() is located in wp-includes/formatting.php.