Re: Dynamically assigning var namesi
| From: | Jo�o C�ndido de Souza Neto | Date: | Tue, 01 Aug 2006 19:29:18 +0000 |
| Subject: | Re: Dynamically assigning var namesi | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-239959@lists.php.net to get a copy of this message | ||
I would like to help, but i need some mor details.
each line of the text file is a flight?
If so, how are separeted each passenger?
It would be important to help me in thinkin somethink to help you.
"bob pilly" <bobpilly@yahoo.co.uk> escreveu na mensagem
news:20060801174905.79517.qmail@web26212.mail.ukl.yahoo.com...
> Hi all
>
> Does anyone know if you can assign a new variable name based on the
> contents of another variable in PHP? If so whats the syntax to do this?
>
> I am parsing a text file that has tens of preset attributes and some of
> these have hundreds of sub attributes. For example the text file contains
> flight details, on every flight there can be up to 500 passengers but
> there are generally only 50 so i dont want to have declare 500 vars when i
> hardly ever use them. What i am trying to do is count the amount of
> pasengers present and dynamically create the variables based on
> this.$surname1,$surname2 etc...
>
> Im not sure whether this is a sane way to approach this problem or not.
> Any advice or pointing to relevant documentation about either syntax for
> this or ways of tackling this sort of problem (im sure it must be a
> regular occurance in the coding world??) would be greatly appreciated!!
>
> Thanks in advance for any help or advice.
>
> Cheers
>
> Bob
>
>
> ---------------------------------
> All new Yahoo! Mail "The new Interface is stunning in its simplicity and
> ease of use." - PC Magazine