do_foo (); "/> do_foo (); ">

Home >Backend Development >PHP Tutorial >初始化object(对象)变量_PHP

初始化object(对象)变量_PHP

WBOY
WBOYOriginal
2016-06-01 12:39:361471browse

要初始化object变量,您使用下面例子中所示的申明方法:

class foo {

function do_foo () {

echo "Doing foo.";

}

}

$bar = new foo;

$bar -> do_foo ();

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:通过UNIX源码编译安装_PHPNext article:设置方法_PHP