RE: [PHP] how do the thing?
| From: | Martin Towell | Date: | Mon, 12 Nov 2001 05:48:39 +0000 |
| Subject: | RE: [PHP] how do the thing? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-74224@lists.php.net to get a copy of this message | ||
once you have read in the file and parsed it up, all you need to do then is
to find the correct "string" to execute and call it using :
eval($string);
happy coding
Martin T
-----Original Message-----
From: Galkov Vladimir [mailto:galkov@kraft-s.php.net]
Sent: Monday, November 12, 2001 4:12 PM
To: php-general@lists.php.net
Subject: [PHP] how do the thing?
Good time of a day!
well... as for me the construction...
switch($action)
{
case ...
..........
}
...is not very elegant when number of cases over 40-60 or more and the only
thing they must do is start one function (often with the same name). for
example:
case 'add_user_form':
{
show_add_user_form();
break;
}
more interesting is to create txt file with records like:
add_user_form>show_add_user_form()
add_user_recoder>add_user_recoder()
.......
So read "show_add_user_form()" is not a problem but how tell PHP that this
is a name of function to start but a simple text string? ...
P/S: I know about reading php manual ;-) may be in an hour or two I'll get
answer on myself but may be somebody can answer qwicker? ;-)
Thancks!
Vladimr.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net