5.2. Use Cases

In each of these use cases, $value represents an arbitrary scalar value.

Whitelist Filtering:

<?php

if ($email = Zend_Filter::isEmail($value)) {
    /* $email is a valid email format. */
} else {
    /* $email is not a valid email format. */
}

?>
    

Blind Filtering:

<?php

$alphaName = Zend_Filter::getAlpha($value);

?>
    

Blacklist Filtering:

<?php

$taglessComment = Zend_Filter::noTags($value);

?>