PHP 中的 FILTER_CALLBACK 常量
phpprogrammingserver side programming
FILTER_CALLBACK 常量调用用户定义的函数来过滤值。
返回
FILTER_CALLBACK 常量不返回任何内容。
示例
以下是转换字符串大小写的示例。这里采用 PHP 中现有的函数。
<?php $string = "DEMO TEXT!"; echo filter_var($string, FILTER_CALLBACK,array("options" = >"strtolower")); ?>
输出
以下是输出。
demo text!