I have constructed the following –
`$format_$game_$name_$season`
4 variables with underscores between. Should this work, or will it act as one variable?
THankyou
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
That wont work, but not because it’ll act as one variable.
First, you need to use double quotes. Backticks wont interpret at all and variables wont be expanded in a single quoted string. Further reading: String Parsing.
Furthermore, when double quoting your string it’ll be interpreted as
$format_ . $game_ . $name_ . $season. That is, PHP will be thinking the three first variables end with an underscore. You’ll have to do either$format . '_' . $game . '_' . $name . '_' . $seasonor"{$format}_{$game}_{$name}_{$season}".