<?php
class Foo{
function varr(){
$name='bar';
$this->$name;//调用Bar方法
}
function bar(){
echo 'i am a bar';
}
}
$foo=new Foo();
$funcname='varr';
$foo->$funcname();//调用varr方法--varr方法再调用bar方法,输出为 i ma a bar.
?>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!