Just a simple question on syntax. To simplify:
$testme[0] = "hello";
$v = "me";
echo $test{$v}[0]; //expect this to output "hello"
Is there any way of writing the final line above such that "me" is referenced by a variable?
Thanks!
Use
echo ${'test' . $v}[0];
instead
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