PHP Callback function not working on object functions

apacttire

New Member
I have an array and want to apply \[code\]MySQLi->real_escape_string\[/code\] on every member of the array through \[code\]array_walk\[/code\] but this is not working:\[code\]array_walk($array, '$mysqli->real_escape_string');\[/code\]It gives this error:\[quote\] Warning: array_walk() expects parameter 2 to be a valid callback, function '$mysqli->real_escape_string' not found or invalid function name in C:\wamp\www\ts.php on line 69\[/quote\]\[code\]$mysqli\[/code\] is a valid object and works fine if I do \[code\]$mysqli->real_escape_string('anything')\[/code\] on anything else.My Question: Is it not possible to pass object's functions as callback ? Or am I doing something wrong.IMPORTANT: I know I can create my own callback function and implement $mysqli->real_escape_string in it BUT I want to know is it not possible to use callback as an object's function ?
 
Back
Top