PhpRiot
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store

Basic usage of filters

Having this filter definition established provides the foundation for Zend_Filter_Interface, which requires a single method named filter() to be implemented by a filter class.

Following is a basic example of using a filter upon two input data, the ampersand (&) and double quote (") characters:

<?php
$htmlEntities 
= new Zend_Filter_HtmlEntities();

echo 
$htmlEntities->filter('&'); // &amp;
echo $htmlEntities->filter('"'); // &quot;

Zend Framework