Hey daarius,
Thanks for the reply.
I didn't write this function (dbDataReady) specifically for use with array_walk(), therefore the return $data is for use when calling dbDataReady() directly:
$someValue = dbDataReady($someValue);
The return has no effect on the results of array_walk().
try these:
array_walk($_POST, 'dataConnection->dbDataReady');
or
array_walk($_POST, 'dataConnection::dbDataReady');
now your $_POST should be cured.
These solutions will not work.
dataConnection is instanciated previously and the object asigned to $_SESSION["dataSource"]:
$dataSource = new dataConnection;
$_SESSION["dataSource"] = $dataSource;
//Which I suppose could be simply:
$_SESSION["dataSource"] = new dataConnection;
in any case the method of the calss has to be called like:
$_SESSION["dataSource"]->dbDataReady();
which is not a problem except when I try to use it with array_walk().
i.e.
array_walk($POST, '$SESSION["dataSource"]->dbDataReady');
array_walk($POST, "\$SESSION[\"dataSource\"]->dbDataReady");
and a host of other attempts will all produce the error:
Warning: Unable to call dataConnection::dbDataReady() - function does not exist
or
Warning: Unable to call $_POST["dataSource"]->dbDataReady() - function does not exist
or a variation there of based on the arg to array_walk().
It would seem that no matter how I try supply the argument name for the method it is interpreted literally or as not as a string representing the name of the method. If that makes sense.
So, how can I supply array_walk() with the function (class method) name in a way that it will be parsed?
Kevin