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

Digits

Returns the string $value, removing all but digits.

Supported options for Zend_Filter_Digits

There are no additional options for Zend_Filter_Digits.

Basic usage

A basic example of usage is below:

<?php
$filter 
= new Zend_Filter_Digits();

print 
$filter->filter('October 2009');

This returns "2009".

<?php
$filter 
= new Zend_Filter_Digits();

print 
$filter->filter('HTML 5 for Dummies');

This returns "5".

Zend Framework