Follow us on Twitter!
It is the path of least resistance that makes rivers and men crooked. - Bj Palmer
Sunday, April 20, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 28
Guests Online: 26
Members Online: 2

Registered Members: 82844
Newest Member: Jimmy Zhang
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

RE: Creating multiple variables in PHP


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 25-08-08 07:06
system_meltdown wrote:
Mr_Cheese wrote:

for ( $i = 0; $i <= 10; $i++ ){
eval("$" . $i = $i);
}



Use the double dollar variable thingy.

Code

for ( $i = 0; $i <= 10; $i++ ){
$$i = $i;
}





this is used to make variable values... variables.. make sense?

$admin = "foo";

$$admin = "bar";

then... you can do: echo $foo, outputs "bar"

make sense?


Variables cannot start with an integer therefore this won't work, because you can't do: echo $1 or anything of the like.


Well, it's already been determined that an array would be friendlier... but, to get around the variable naming issue... use $$chr($i+65). 65-90 is the range for ASCII A-Z.

Bump.