Jump to content

nmts

New Members
  • Posts

    2
  • Joined

  • Last visited

nmts's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. nmts

    php rand function

    Can anyone explain how this function actually works? Is there a way to write your own random function? Not that I need to, but it would be cool to understand it
  2. nmts

    OOP Example

    Index.php <?php $stefan = new person("Stefan Mischook"); echo "Stefan's full name: ".$stefan->get_name(); ?> class_lib.php <?php class person { var $name; function __construct($persons_name) { $this->name = $persons_name; } function set_name($new_name) { $this->name = $new_name; } function get_name() { return $this->name; } } ?> Why even have var $name; if the code works fine without it? With the construct, would there be a need for the set_name function?
×
×
  • Create New...