note 10200 deleted from functions.variable-functions by goba
| From: | goba@php.net | Date: | Sun, 01 Dec 2002 10:54:18 +0000 |
| Subject: | note 10200 deleted from functions.variable-functions by goba | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-40207@lists.php.net to get a copy of this message | ||
Re: Variable functions and classes
The kcavness@proxicom.com method don't work (parse error of course). The php@timewarp.org
method works, but the variable function must exist in the class. If you want inside a class have a
var storing the name of a generic function (like mysql_connect in a class of db connection that you
can later port to Oracle in a breeze), you got to store the name in an array :
$this->funcs = array()
$this->funcs["connect] = "mysql_connect" ;
$this->funcs["select"] = "mysql_select_db" ;
...
Then later you can connect to the mysql daemon using :
$this->funcs["connect"]($host,$user,$pass) ;