$p2
$p4
$p6
I did think about $"p".$a but that did not work. Can anybody shed some light on this matter?
Code: Select all
<?php
echo <<<END
<input type="Submit" value = "Echo" name ="Submitter">
END;
$fr = "hello"; #Is a MySQL query, but as I am just wondering about the variables, it is not needed.
$len = strlen($fr);
$a = 0;
for ($i = 1; $i <= $len; $i++) {
$a = $a +2;
$"p".2 = $a #This is the line which should be able to update
}
$len2 = $len/2;
if (isset($_POST['Submitter'])) {
$p = 0;
for ($i = 1; $i <= $len2; $i++) {
$p = $p+2;
echo $"p".$p;
}
}
?>