getting an variable value from an array entry

From: Date: Sun, 30 Nov 2003 20:27:10 +0000
Subject: getting an variable value from an array entry
Groups: php.general 
Request: Send a blank email to php-general+get-171414@lists.php.net to get a copy of this message
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

Attachment: [application/pgp-signature]
« previous php.general (#171414) next »