Sanitize a string from user input or from the db.
Checks for invalid UTF-8, Convert single < characters to entity, strip all tags, remove line breaks, tabs and extra white space, strip octets.
<?php sanitize_text_field( $str ) ?>
sanitize_text_field() is located in wp-includes/formatting.php
sanitize_text_field() is in a class of functions that help you sanitize potentially unsafe data which allow you to pass an arbitrary variable and receive the clean version based on data type. Others include: