<?php
//参数1,正则表达式
//参数2,匿名回调函数
//参数3,匹配的字符串
echo preg_replace_callback(
'~-([a-z])~',
function ($match){return strtoupper($match[1]);},
'-hello-world'
);
<?php
//参数1,正则表达式
//参数2,匿名回调函数
//参数3,匹配的字符串
echo preg_replace_callback(
'~-([a-z])~',
function ($match){return strtoupper($match[1]);},
'-hello-world'
);
上一篇:php--斐波那契数列
下一篇:php--继承类class的使用
php 匿名函数案例
一个PHP脚本。一般都不用考虑内存泄漏和垃圾回收的问题,因为脚本很快就执行完退
PHP中的匿名函数(Anonymous functions), 也叫闭包函数(closures), 允许指定一个没有名称的函数。最常用的就是回调函数的参数值。
建立数据源: 开始菜单->设置->控制面板->管理工具->数据源(ODBC)->系统DSN->添加->选择MySQL ODBC 3.51 Driver(我下载的MyODBC版本是3.51) 然后在出现的Connector/ODBC&nbs
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M