I want to store courseworks marks of n courseworks into n variables, such as cw1 and cw2 etc. Using variable variables how can I come with cw1, cw2 etc.
How can I d
Variable variables work in this way
$var = "foo";
$$var = "bar";
echo $foo; // bar
But i do not recommend doing this, since what if the value of $var changes, then you can no longer print out the 3rd line in this code.
If you could elaborate more on what you want to do i think we could help you more.