You are here: Re: Turning a variable in to a string « All PHP « IT news, forums, messages
Re: Turning a variable in to a string

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация