<?php
header("Content-type:text/html;charset=utf-8");
class user{
function select($id)
{
mysql_connect('localhost','root','123');
mysql_select_db('bkw_guest');
mysql_query('set names utf-8');
$rs=mysql_query("select * from bkw_subject limit 0,10 where sujbect_id=$id");
while($row=mysql_fetch_row($rs)){
$rows[]= $row;
}
return $rows;
}
}
function sysHello($user){
echo 'hello,'.$user;
}
$name="matao";
$rows=call_user_func(array('user','select'),4);//调用类的方法,并传递参数
print_r($rows);
echo "/n";
echo call_user_func('sysHello',$name);//调用参数 ,并传递参数
?>
call_user_func 使用方法
最新推荐文章于 2021-04-03 18:22:32 发布