<form action="" method="get">
Data: <input type="text" name="data" maxlength="64" size="64"/><br/>
<input type="submit"/>
</form>
<?php
$options = FILTER_FLAG_STRIP_HIGH;
if (isset($_GET['data'])) {
$data = filter_input(
INPUT_GET, // source
'data', // parameter name
FILTER_SANITIZE_STRING, // filter
$options // options
);
var_dump( $data );
}
?>
Output