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

Heim >Backend-Entwicklung >PHP-Tutorial >初始化object(对象)变量_PHP

初始化object(对象)变量_PHP

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 12:39:361527Durchsuche

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

class foo {

function do_foo () {

echo "Doing foo.";

}

}

$bar = new foo;

$bar -> do_foo ();

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn
Vorheriger Artikel:通过UNIX源码编译安装_PHPNächster Artikel:设置方法_PHP