PHP - Programming Language
This course covers the basics of programming in PHP. Work your way through the videos and we'll teach you everything you need to know to start your programming journey!

Object Methods

Lesson 31
Author : Mike Dane
Last Updated : November, 2017


Code

Copyclass Student{
     public $name;
     public $gpa;

     function __construct($name, $gpa){
          $this->name = $name;
          $this->gpa = $gpa;
     }

     function hasHonors(){
          if($this->gpa >= 3.5){
               return true;
          }
          return false;
     }
};