value contained within a variable contained within another variable

From: Date: Wed, 17 Sep 2003 17:18:01 +0000
Subject: value contained within a variable contained within another variable
Groups: php.general 
Request: Send a blank email to php-general+get-162899@lists.php.net to get a copy of this message
I may be way off track with what I am trying to do, but here is my scenario and I sure appreciate any insights. There is a string stored in $kk1_current and I want to pull from the array the variable name, add the "$" and then retreive the string with the varialbe $kk1_current. This will allow to echo the contents of each varialbe contained with the array. Make sense? $kk1_current = "something"; $data = array ("kk1_current","kk2_current","mk_current"); $temp = "$" . $data[0]; $data_post = strval($temp) . "\n"; // I want, $data_post = whatever is inside $kk1_current in this example -- strval obviously doesn't work in the case echo $data_post; THANKS!

« previous php.general (#162899) next »