I need to use the class callback method for an array inside another method (the callback function belongs to the class).
class Database { public function escape_string_for_db($string){ return mysql_real_escape_string($string); } public function escape_all_array($array){ return array_map($array,"$this->escape_string_for_db"); } }
Is this the right way? (I mean, by the second parameter passed to array_map )
arrays methods php callback class
Gal
source share