A variable variable in PHP

<?php
$varname = 'tireqty';

$$varname = 100;

echo $tireqty; // output: 100
?>

Comments

Popular posts from this blog

Timus Problem 1086. Cryptography Accepted Solution in C

Rolling a dice in PHP

Replace every instance of a substring in PHP