You are here: Variable in a variable name « PHP Programming Language « IT news, forums, messages
Variable in a variable name

Posted by Garry Jones on 04/13/06 13:50

I have an entry page which can be used to key in data for ten people. My
assigned variables for each field are in line with

$personage1
$personage2
....etc
$personage9
$personage10

and so on. (I have 8 fields for every person, 80 values in all).

To simplify my code and make changes easier I would like to create and use
these variables with a variable "x" in the name

This by recycling the code with $personX in and changing the value of x and
running the code ten times. Probably in some kind of do while loop (fairly
new to php, but I have been using Excel VB for years and am familiar with
the syntax and effectiveness of Do While Loops).

1) how do I put a variable in a variable name?
2) syntax for a do while loop with this variable name.

The beauty is if I can get this working I can make x=1 the first time adding
one each time and using value of X in my while statement.


Garry Jones
Sweden

 

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

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