Possible Duplicate:
Can I use a generated variable name in PHP?
Am stuck here!
$part_one = "abc";
$v = "one";
echo $part_???; // should output "abc"
How do I modify ??? to reference $v?
Thanks!
You need variable variables:
echo ${'part_'.$v};
// or
$var = 'part_'.$v;
echo $$var;
$_part$v;? maybe idk. I know you can do this:
$vname="variable";
$$vname="hello";
echo $variable;
//WOULD output "hello"
try this:
$name="_part";
$name=$name . $v;
$$name=$value;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With