Destramic Posted October 4, 2011 Share Posted October 4, 2011 hey guys i have a __call method in my class...the probelm im having is how to get the arguments into this line return $this->_db->$method($arguments); if arguments where "test1" and "test2" i want the call to do return $this->_db->$method("test1", "test2"); the code below will put all arguments into one if anyone can help me on how i can seperate please public function __call($method, $arguments) { if (method_exists($this->_db, $method)) { $arguments = implode(', ', $arguments); return $this->_db->$method($arguments); } } Link to comment https://forums.phpfreaks.com/topic/248411-__call-magic-method/ Share on other sites More sharing options...
AbraCadaver Posted October 4, 2011 Share Posted October 4, 2011 call_user_func_array Link to comment https://forums.phpfreaks.com/topic/248411-__call-magic-method/#findComment-1275658 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.