note 11908 modified in function.call-user-method by vrana
| From: | vrana@php.net | Date: | Tue, 17 Aug 2004 14:53:59 +0000 |
| Subject: | note 11908 modified in function.call-user-method by vrana | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-79724@lists.php.net to get a copy of this message | ||
You can also dynamically call functions through variable variables...for example:
<?php
class xyz{
function mybar($str)
{
echo $str;
}
}
$xyz = new xyz;
$foo = 'bar';
$xyz->{'my'.$foo}('dynamic call to function');
?>
--was--
You can also dynamically call functions through variable variables...for example:
class xyz{
function mybar($str)
{
echo $str;
}
}
$xyz = new xyz;
$foo = 'bar';
$xyz->{'my'.$foo}('dynamic call to function');
http://php.net/manual/en/function.call-user-method.php