Is there a way to make a variable be like this:
say $x = 3
so I want the variable to be $3_sc
and if $x=2
it would make the variable $2_sc
I am just wondering thanks
Thanks
Variable with variable value
Moderator: General Moderators
- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida
Yup, but a variable can't start with a number.
Code: Select all
$bob_whatever = "hello!";
$x = "bob";
$x .= "_whatever";
echo $$x;
//outputs hello!- tecktalkcm0391
- DevNet Resident
- Posts: 1030
- Joined: Fri May 26, 2006 9:25 am
- Location: Florida