Currently, as an example, I have this php code on one of my pages.
<?php include("codes/games/scripts/titles/angrybirds.php"); ?>
How would I change this to make my variable:
$gametitle = "angrybirds";
work like this:
<?php include("codes/games/scripts/titles/$gametitle.php"); ?>
Thanks in advance for your help!
That code should work as-is, since the
.won’t be interpreted as part of the variable name. You can see the output of it here: http://codepad.org/ZbtiOPgBHowever, for readability, I would encourage you to either use clear concatenation:
Or wrap your variable name(s) in
{and}: