Home > Article > Backend Development > The meaning of the connection symbols greater than sign and equal sign greater than sign in PHP
PHP, I encountered
-> and =
> these two symbols.
<?php class Car { public $speed = 0; //增加speedUp方法,使speed加10 public function speedUp(){ $this->speed+=10; } } $car = new Car(); $car->speedUp(); echo $car->speed; ?>
In this, we can see that a speedUp method is defined in the class. In this method, we can see
$this->speed =10, this line of code. ->What does it represent?
<?php //从数组变量$arr中,读取键为apple的值 $arr = array('apple'=>"苹果",'banana'=>"香蕉",'pineapple'=>"菠萝"); $arr0=$arr["apple"]; if( isset($arr0) ) {print_r($arr0); } ?>In this code, first declare an arr array, and then declare a key where arr0 is equal to Apple. Then use IF to determine whether it exists. If it exists, output the value on the right side of the key in the array. . To put it simply, it means giving someone a nickname, using a nickname to represent a certain person, and by mentioning his nickname, you can know who he is.
Recommended: 《2021 PHP interview questions summary (collection)》《php video tutorial》
The above is the detailed content of The meaning of the connection symbols greater than sign and equal sign greater than sign in PHP. For more information, please follow other related articles on the PHP Chinese website!