note 7401 modified in Variable variables by ronabop

From: Date: Sat, 10 Mar 2001 23:40:59 +0000
Subject: note 7401 modified in Variable variables by ronabop
Groups: php.notes 
Request: Send a blank email to php-notes+get-12246@lists.php.net to get a copy of this message
Hello (I guess pre tags are broken, but will use them anyway incase they get fixed.) The most important useage of veriable veriable that I have found is not even mentioned here. That is, function veriables: $funcvar="my_formdatafunc"; $$funcvar(); // calls the function w/no parameters. ${$funcvar( $var1, "string", $nutervar)}; // w/parameters I've been using this undocumented feature for some time and only just now realized that it is undocumented. It is most usefull with form data processing to handle multiple forms with one script and such. Where $funcvar my be the name of a database table used as a function name. Terry Mackintosh <terry@terrym.com> http://www.php.net/manual/variable-variables.php

« previous php.notes (#12246) next »