Re: Variable name as a string

From: Date: Wed, 27 Aug 2008 14:22:02 +0000
Subject: Re: Variable name as a string
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-278774@lists.php.net to get a copy of this message
ioannes wrote:
Could someone tell me how to get the name of a variable as a string. This would be useful in form submission with multiple check-boxes to match against database records. At the moment I use ${"var".$ID[$x]} or someting like that to go through all the possible matches, but it would be quicker to explode the name of a checkbox like a string like cb_1 to match to record 1 etc. There is some reason I do not use the value of the check box, but I can't remember it now! John
For database use I do the following in forms: name="data[field_name]" Or for multiple table that you update together: name="data[table_name][field_name]" -Shawn

« previous php.general (#278774) next »