<?php
$j7=6;
$b=7;
$test= '$j'.$b;
echo $test;
?>
How to make the result of echo $test is 6 instead of $j7?
<?php
$j7=6;
$b=7;
$test= '$j'.$b;
echo $test;
?>
How to make the result of echo $test is 6 instead of $j7?
You're looking to do the following:
$test = "${'j'.$b}";
echo $test; //Outputs 6
You're working with variable variables which essentially defines a variable based on another variable's contents.