Small question about $this
活着
活着 2017-09-05 15:22:57
0
3
1191

Excuse me, this $this ——》How do you type the one behind this this? What is it?

活着
活着

reply all(3)
phpcn_u2434

Someone has answered the function and I will answer how to use it. . . This is so simple. In non-input method mode, add the - sign to the right of the + sign on the main keyboard 0 and to the left? The > sign to the left of the key, this > can only be typed by holding down the shift key. To switch between input method mode and letter input mode, just press shift.

ringa_lee

First of all, you need to understand what $this is and what is its role?

$this is a pointer to the current object. To put it bluntly, it means the previous object. This can realize, for example, class attribute method calls, etc.

阿布是老黑

$this->So-and-so method.

For example

class man{

function test1(){

$this->test2();

}

function test2(){

echo "hello";

}

}

$m = new man();

$m->test1();

//Output: hello;


Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template