do_foo (); "/> do_foo (); ">
Home >Backend Development >PHP Tutorial >初始化object(对象)变量_PHP
要初始化object变量,您使用下面例子中所示的申明方法:
class foo {
function do_foo () {
echo "Doing foo.";
}
}
$bar = new foo;
$bar -> do_foo ();