Is there any way to use a variable of a method, after a recursive call (without sending that as a parameter).
For example:
class Doc {
public function readDoc($file, $recursion = false) {
if ($recursion != false) {
// DO SOMETHING;
}
$filename = $file."Some added text";
$this->readDoc($filename, 1);
}
}
Here, is it possible to use the value of $file sent in the first call (when the readDoc() function is called recursively).