zahl hinter variable schreiben
muenzchen
- php
ich habe diese frage ja schon mal gepostet aber da hat scheinbar niemand genau verstanden was ich meine. deshalb ein beispiel:
<input type="text" name="text1">
<input type="text" name="text2">
<input type="text" name="text3">
<input type="text" name="text4">
<input type="text" name="text5">
<?php
for ($i=1;$i<=5;$i++) {
print "text".$i; <== Wie funzt das, falls es überhaupt funzt ?
}
?>
Hallo !
Der Tip von soenk.e (link:/?m=8252&t=1343) war m.E. völlig in Ordnung.
Lt. Handbuch (siehe: http://www.php.net/manual/de/language.variables.variable.php) sollte es so gehen:
for ($i=1;$i<=5;$i++) {
{
$var="bild" . $i;
echo "Wert von $var: $($var)";
};
Gruß,
kerki
Hallo nochmal! :-)
Die 2 Links nochmal für zum Klicken:
</?m=8252&t=1343>
http://www.php.net/manual/de/language.variables.variable.php
Gruß,
kerki
ok werds mal probieren. danke :)
Hallo
Geht das eigentlich auch bei Perl?