php create class with no variables to pass in function -
lets have class function in it:
classes.php
class foobar{ function writeword($word){ return $word; } }
on page call class need initialize class, call later.
php2.php
require_once('classes.php'); $something = new foobar(); echo $something->writeword('dog');
the problem here php comes , says foobar missing arguments on line 1. how can solve this?
Comments
Post a Comment