RE: [PHP] getting an variable value from an array entry
| From: | Bronislav Klucka | Date: | Sun, 30 Nov 2003 20:44:50 +0000 |
| Subject: | RE: [PHP] getting an variable value from an array entry | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-171416@lists.php.net to get a copy of this message | ||
The temperature is $$temp
Brona
> -----Original Message-----
> From: Ian Truelsen [mailto:ian@ihtruelsen.dyndns.org]
> Sent: Sunday, November 30, 2003 9:27 PM
> To: php
> Subject: [PHP] getting an variable value from an array entry
>
>
> I am trying to do the following:
>
> I have a text file to read in that contains something like "The
> temperature is $temp"
>
> This gets read into an array so that I can parse it out word by word
> (the only way I could think to do this, any other ideas are welcome). I
> do a test to see whether the first letter is a $ and then pull try to
> print $temp.
>
> What I can't figure out is how to have the value of $temp printed as
> opposed to "$temp" which is where I am at the moment. I have tried the
> complex {} approach from the manual, but it doesn't get me what I am
> looking for.
>
> Can anyone tell me what the appropriate syntax would be for doing this?
> Or some other way to deal with the issue would be good as well.
>
> Thanks in advance.
>
> --
> Ian Truelsen
> Email: ian@ihtruelsen.dyndns.org
> AIM: ihtruelsen
> Homepage: http://www.ihtruelsen.dyndns.org
> Signature key (742B740D) available at pgp.mit.edu
>
>