:-
1-
2-
3-
4-
&-
&-
5-
6- construct destruct
7-
8-
9- private, public, protected
10-
11-
12-
-------------------------------------------------
1- :
php Object Oriented Program(OOp ) PHP4 PHP5 Zend
php4
.
2- :
PHP:
Class
{
//
}
3-
var
:
PHP:
class TV // TV
{
var ;
}
PHP:
class TV // TV
{
var $tardod= 12036; //
// 12036
}
PHP:
class TV // TV
{
var $tardod= array(); //
}
3-
Function
http://www.traidnt.net/vb/showthread.php?t=83181
class
PHP:
class TV
{
function ()
{
//
}
}
PHP:
class TV
{
function print_msg ($message)
{
print "<div>$message</div>";
}
}
&-
PHP:
$this->
PHP:
class TV //
{
//
var $color= ' ';
function tv_color()
{
echo "
$this-> color";
}
/*
$this->
color
*/
}
Code:
$this->
PHP:
$this->
PHP:
$this->$
:
PHP:
class TV //
{
//
var $color= ' ';
function tv_color()
{
return"
$this-> color";
}
function total()
{
print $this->tv_color(); // tv_color
//
}
}
&-
new
PHP:
//
$tv = new ;
//
$tv-> ();
PHP:
class TV //
{
//
var $color= ' ';
function tv_color()
{
return"
$this-> color";
}
function total()
{
print $this->tv_color(); // tv_color
//
}
}
$tv= new TV;
$tv->color='';
print $tv->total();