php - How to echo custom function -
i have function
function getservertitle() { return($this->_values[$this->_indexes["servertitle"][0]]["value"]); }
and wanted echo it, doesn't work.
echo getservertitle();
it shows
fatal error: call undefined function getservertitle()
since body of function contains references $this
, not function in older sense of word, non-static method on class.
this implies, way run in meaningfull way instantiate class , call method of resulting object.
e.g.
$object=new your_class_name(); echo $object->getservertitle();
Comments
Post a Comment