Archive

Posts Tagged ‘dynamic variables’

Dynamic variable names in PHP

August 18th, 2009 Flashnutz No comments

I'm going to show you how to use dynamic variable names in php. It's quite simple, just put your variable name in between {} symbols.

// declare prefix. In a loop this would probably be a number.
$prefix = "pfx";
 
// build your variable
${"varname_{$prefix}"}    = "success";
 
//This would output "success"
echo $varname_pfx;

Simple isn't it....

Become a dyneaming online video poker game player on the video poker games of CasinoBonus.org where you can also learn the history of video poker !

Post to Twitter Post to Plurk Plurk This Post Post to Yahoo Buzz Buzz This Post Post to Delicious Delicious Post to Digg Digg This Post Post to Ping.fm Ping This Post Post to Reddit Reddit Post to StumbleUpon Stumble This Post

SEO Powered by Platinum SEO from Techblissonline