开发者

How to generate a custom Zend filter from a regular expression

开发者 https://www.devze.com 2023-03-28 09:16 出处:网络
I want to realize a Zend_Filter that return the string replacing banks with underscore and remove all the characters not all开发者_高级运维owed in a regular expression.

I want to realize a Zend_Filter that return the string replacing banks with underscore and remove all the characters not all开发者_高级运维owed in a regular expression.

Is that possible?


$filter = new Zend_Filter_PregReplace();
$filter->setMatchPattern(array(' ', '/regexForCaracterNotAllowed/'))
       ->setReplacement(array('_', ''));

This is how to use the Zend_Filter_PregReplace. What are the not allowed caracters?

0

精彩评论

暂无评论...
验证码 换一张
取 消