I’m writing my own php class and I have several functions within that class. But am I not allowed to call a function from another function within the same class? Something like this:
class my_Class {
function one($arg) {
//does something
}
function two($var) {
$receive = one($var);
}
}
I tried something like this and it spat out an error saying:
Fatal error: Call to undefined function one()
What am I doing wrong?
Change it to this:
Review the PHP OOP reference: http://www.php.net/manual/en/language.oop5.php
The
$thiskeyword is always required.