call_user_func_array — 调用回调函数,并把一个数组参数作为回调函数的参数
2024-08-29 02:38:07
<?php
function foobar($arg, $arg2) {
echo __FUNCTION__, " got $arg and $arg2\n";
}
class foo {
function bar($arg, $arg2) {
echo __METHOD__, " got $arg and $arg2\n";
}
} // Call the foobar() function with 2 arguments
call_user_func_array("foobar", array("one", "two")); // Call the $foo->bar() method with 2 arguments
$foo = new foo;
call_user_func_array(array($foo, "bar"), array("three", "four"));
?> 以上例程的输出类似于:
foobar got one and two
foo::bar got three and four
最新文章
- IOS之推送通知(本地推送和远程推送)
- 【POI xls】解析xls遇到的问题
- 巧用Windows 7计划任务设置定时提醒
- 【转】oracle数据库中varchar2陷阱
- JAVA多线程解惑之多线程返回值
- Extjs4 关于设置form中所有子控件为readOnly属性的解决方案
- web前端开发中Nodejs、Grunt、npm等的介绍、使用
- poj2478--欧拉函数打表
- 基于KNN的相关内容推荐
- EasyUI整合篇
- Oracle导入建表的sql文件类型
- Flask--(登录注册)抽取视图函数
- junit 基础使用
- compact 创建一个包含变量名为数组的键和它们的值为数组的值的数组
- [daily][ulimit][coredump] 快速简单粗暴的用coredump调试
- LeetCode--014--最长公共前缀(java)
- Python语言规范
- Docker集群管理(一)—— 基础docker+swarm+shipyard
- Ubuntukylin-14.04-desktop( 不带分区)安装步骤详解
- Effective STL 学习笔记14: Use reserve to avoid unnecessary reallocations.
热门文章
- MapGIS IGServer for java
- vue项目中使用element的dialog中引入ztree却不能初始化解决办法
- (转)基于TLS证书手动部署kubernetes集群(下)
- PHP的重载-使用魔术方法实现
- 初次打开jenkins页面一片空白的解决办法
- Linux 文件和目录的权限设置 - umask(默认权限),chmod(改变权限)
- Vagrant 入门 - 项目设置
- 16/7/14-MySQL-修改mysql5.6以上版本root密码
- (转)Linux下编译安装log4cxx
- Pikachu漏洞练习平台实验——越权漏洞(八)