📜  在 php 代码示例中访问类

📅  最后修改于: 2022-03-11 14:54:11.755000             🧑  作者: Mango

代码示例1
class person {
     //properties
        public $name;
        public $age;
        public $email;

     //function
        public function setProfile($name, $age, $email) {
     //We use this->name to point out the properties above
            echo $this->name = $name. "
"; echo $this->age = $age. "
"; echo $this->email = $email; } }; $profile = new person; //those parameters are from the function parameters $profile->setProfile("parameter1", "parameter2", "parameter3"); ?> /* I'am Harniel Amuin hope this helps */