Hans Gustav: $$val

Beitrag lesen

achso nier

wie bekomme ich es dann hin das mir der variablen name ohne $ ausgegeben wird wenn ich ein array und eine schleife habe:

<?php
$VAR1 = "test ahllo";
$VAR2 = "test";
$VAR3 = "ahllo";

$strings[] = $VAR1;
$strings[] = $VAR2;
$strings[] = $VAR3;

for ($i=0; $i <= count($strings)-1; $i++)
{
 $string = $strings[$i];
 print "Der inhalt von NAME_DES_STRING ist $string<br>";
}
?>

----------------------

Ausgabe:

Der inhalt von VAR1 ist test ahllo
Der inhalt von VAR2 ist test
Der inhalt von VAR3 ist ahllo

----------------------

Wie bekomme ich das hin?