Codex tools: Log in
Strips out all characters that are not allowable in an email.
sanitize_email() has done its work, it passes the sanitized e-mail address through the sanitize_email filter.
<?php sanitize_email( $email ) ?>
<?php $sanitized_email = sanitize_email(' email@example.com! '); echo $sanitized_email; // will output: 'firstname.lastname@example.org' ?>
sanitize_email() is located in
sanitize_email() 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: