|
Posted by Tyrone Slothrop on 08/18/05 01:20
On Wed, 17 Aug 2005 17:54:42 -0400, Dave Thomas <gentso@hotmail.com>
wrote:
>I have:
>$this_array = array($test_year, $test_color, $test_food)
>
>I want to access another variable based on $test_year, only it will be
>called $test_month (test could be something else). $test_year is a form
>and I want to access $test_month.
>
>If I use $this_array[1] then I am getting the actual value of the form.
>I want to get the name of the variable I am accessing!
Anyone else understand this? I sure don't! Not sure how you expect
to view the var name without having a multi-dimensional array. If you
are referring to $_POST vars submitted by a form, then the vars can be
assigned:
foreach ($_POST as $k=>$v) {
echo "$k = $v\n";
}
Navigation:
[Reply to this message]
|