0

I"m trying to ask if $value1 is 1

$value1 = 1;
$num = 1;

if ($['value'] . $num == 1) {
echo 'good';
} else {
echo 'bad';
}
PushApp CO
  • 11
  • 1
  • What you need in dupe is __variable variables__. – u_mulder Aug 17 '20 at 10:17
  • 1
    Use `$$` syntax (variable variables). Demo: http://sandbox.onlinephpfunctions.com/code/d6250ffb54c22a5f500cacc228ce47275971cb1a . Here's some more explanation: https://stackoverflow.com/questions/2715654/what-does-dollar-dollar-or-double-dollar-mean-in-php – ADyson Aug 17 '20 at 10:18

0 Answers0