11-30-2009, 10:22 PM
|
#13 (permalink)
|
|
The Addict
Join Date: May 2009
Posts: 287
Thanks: 5
|
You could also try something similar to this, it's not overloading, but still allows multiple amounts of arguments. This would really allow you to send any number of parameters and values, it would just take a while to process if you have a lot.
PHP Code:
function d($data = array()) { foreach($data as $key => $value) { switch ($key) { 'speak': echo $value; break; 'save': $this->db->save($value); break; } } }
d(array( 'speak' => 'Adam' ));
d(array( 'speak' => 'John', 'save' => $name ));
|
|
|
|