Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

$$ variable variable

Status
Not open for further replies.

lonelydragon

Programmer
Aug 5, 2004
75
US
i am trying to name a variable with a varaible, but met some broblem.

$userArray[] = array('pntr','userLevel',....);
$userInfo[] = array('gdf','dfgdf',....);

for($i=0;$i< count($userInfo);$i++){
$myVal = 'this->'.$userArray[$i];
$$myVal = $userInfo[$i];
}


what i want is : $this->pntr=$userInfo[$i];

anyone can help? thanks

 
no one reply?
i got it.

for($i=0;$i< count($userInfo);$i++){
$this->$userArray[$i] = $userInfo[$i];
}

easy? sure
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top