View Single Post
  #5 (permalink)  
Old May 10th, 2007, 21:35
masonbarge's Avatar
masonbarge masonbarge is offline
Highly Reputable Member
Join Date: Jan 2006
Location: Atlanta GA
Posts: 631
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Any way to use a var within a predefined var?

While I'm at it, if my first try didn't do the trick, this snippet may help you figure out what you want to do. It is really two different approaches.
PHP: Select all

foreach ($_SESSION as $k => $v) {
     echo 
'<br />$_SESSION[' $k .'] ';
     echo 
"is set to $v. <br />";
     global $
$k;
     echo 
"$$k has a value of $v. <br />";
 } 
I use something like this sometimes with an intro "The following session variables are set".
Reply With Quote