ZF框架Filter过滤器的简单使用
程序员文章站
2022-05-18 10:29:26
...
学习作业 Zend Framework ?php/*过滤器的简单使用方法及操作()*/require_once("Zend/Loader.php");//引入Filter的字符串转小写类 与 转大写类Zend_Loader::loadClass("Zend_Filter_StringToLower");Zend_Loader::loadClass("Zend_Filter_StringToUpper");//实
学习作业 Zend Framework
filter($Temp); $Result2 = $Filter2 -> filter($Temp); echo $Result; echo $Result2; ?>
addFilter(new Zend_Filter_Htmlentities()); -> addFilter(new Zend_Filter_StripTags()); $String = "链接"; $Result = $Filter -> filter($String); echo $Result; ?>
$v) { $value = str_replace($v, '*', $value); } return $value; } } $Filter = new MyFilter(); $String = '这条信息是黄色内容'; $String2 = '他今天去赌博了'; $String3 = '他今天去吸毒了'; echo "
过滤内容
"; echo $Filter -> filter($String) . "
"; echo $Filter -> filter($String2) . "
"; echo $Filter -> filter($String3) . "
"; ?>