Answers for "accessing class in php"

PHP
0

accessing class in php

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. "<br>";
            echo $this->age = $age. "<br>";
            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
    */
Posted by: Guest on October-20-2021

Code answers related to "accessing class in php"

Browse Popular Code Answers by Language