variables names
Posted: Mon Oct 30, 2006 8:13 am
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Hi
I have a form that is created with diferents fields, the user pick 3 fields, so the form for this user as field1 field2 and field3, but other user may need 4 fields so the form is created with 4 fields, field1 field2 field3 and field4.
So my question is: is possible create name of variables dynamic? the code that i want is to catch all the fields that i have in my form:Code: Select all
<?php
$field1 = $_GET['field1'];
$field2 = $_GET['field2'];
#to make this in a for cicle, for my variables names have the "field".$i - where $i is the nunmber of the field
# example, if $i=1 i wnat to create a code line like this $field1 = $_GET['field1'];
# field is fixed name and the rest of the name of the variable came from $i
#is this possible?
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]