A Class With A Method

<?php
class Item {
  var $name = "item";  function getName() {
    return "item";
  }
 } $item = new Item ();
 print $item->getName ();
?>

Enjoyed this post? Share it!

 

Leave a comment

Your email address will not be published.