06c04-1.php
来自「介绍PHP5的给类型函数应用」· PHP 代码 · 共 20 行
PHP
20 行
<?php// If input came via _POST then it was a form submission, trim the // data and return it:if (count($_POST) > 0) { $prepped = create_function('$a', 'return trim($_POST[$a]);');}// If this is a GET, then assume these are configuration parameters,// and that we need to not trim, but ensure they are upper case:elseif (count($_GET) > 0) { $prepped = create_function('$a', 'return strtoupper($_GET[$a]);');}// Else, we had no input, create a function that just always returns false.else { $prepped = create_function('$a', 'return false;');}// Now call this function to retrieve a certain value:echo $prepped('file');?>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?