Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

PHP OOP - Classes and Objects

<?php
class Fruit {
  // Properties
  public $name;
  public $color;

  // Methods
  function set_name($name) {
    $this->name = $name;
  }
  function get_name() {
    return $this->name;
  }
}
?>
 
PREVIOUS NEXT
Tagged: #PHP #OOP #Classes #Objects
ADD COMMENT
Topic
Name
8+2 =