note 30273 added to function.call-user-func-array
| From: | nutbar at innocent dot com | Date: | Wed, 12 Mar 2003 18:29:52 +0000 |
| Subject: | note 30273 added to function.call-user-func-array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-45165@lists.php.net to get a copy of this message | ||
This function, combined with some others, can allow you to make some really easy & generic
function macros (since real macros don't exist in PHP yet).
function my_printf() {
$args = func_get_args();
return call_user_func_array('printf', $args);
}
This allows you to use my_printf() just as if it were printf() itself. Very useful since you
don't have to worry about how many arguments any functions take.
--
http://www.php.net/manual/en/function.call-user-func-array.php
http://master.php.net/manage/user-notes.php?action=edit+30273
http://master.php.net/manage/user-notes.php?action=delete+30273
http://master.php.net/manage/user-notes.php?action=reject+30273