func_get_args detect context
- by Steve
I have a script where it accepts a varying number of arguments.
I want to use func_get_args to perform operations on said arguments. If I have one function like this:
function Something() {
foreach(func_get_args($this) as $functions) {
// Do something
}
// Return..
}
I want to be able to call this function in, for example, another function to add/save entries. The add/save function would have arguments 'title', 'description' etc..
I basically want to know if there is a way to detect the context of a function call. Can I pass something to func_get_args that will let it know that its called in a certain function? So if I do:
function Save($title, $desc) {
$vars = $this->Something();
}
I want $vars to contain $title and $desc after modifying them.