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

Popular posts from this blog

apache - setting document root in antoher partition on ubuntu -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -

Process 'command 'F:\android-sdk\build-tools\21.1.2\aapt.exe'' finished with non-zero exit value 1 -