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

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

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