Nabend zusammen,
ich stehe gerade auf dem Schlauch.
Ich wollte gerade eine Variable ($text) mit dem Wert $i "erweitern". (Also so >> $text$i)
So das - Text 1 - dann - Text 2 und so weiter angezeigt wird am jeweiligen Tag.
Jetzt bekomme ich aber einfach keine Ausgabe, obwohl der Text vorhanden ist.
Was mach ich hier falsch ?
EDIT: Also es wird nur die Zahl ausgegeben, die heute ist (Bsp.: 27)
ich stehe gerade auf dem Schlauch.
Ich wollte gerade eine Variable ($text) mit dem Wert $i "erweitern". (Also so >> $text$i)
So das - Text 1 - dann - Text 2 und so weiter angezeigt wird am jeweiligen Tag.
Jetzt bekomme ich aber einfach keine Ausgabe, obwohl der Text vorhanden ist.
Was mach ich hier falsch ?
PHP-Code:
$text1 = "Text 01";
$text2 = "Text 02";
$text3 = "Text 03";
$text4 = "Text 04";
$text5 = "Text 05";
$text6 = "Text 06";
$text7 = "Text 07";
$text8 = "Text 08";
$text9 = "Text 09";
$text10 = "Text 10";
$text11 = "Text 11";
$text12 = "Text 12";
$text13 = "Text 13";
$text14 = "Text 14";
$text15 = "Text 15";
$text16 = "Text 16";
$text17 = "Text 17";
$text18 = "Text 18";
$text19 = "Text 19";
$text20 = "Text 20";
$text21 = "Text 21";
$text22 = "Text 22";
$text23 = "Text 23";
$text24 = "Text 24";
$text25 = "Text 25";
$text26 = "Text 26";
$text27 = "Text 27";
$text28 = "Text 28";
$text29 = "Text 29";
$text30 = "Text 30";
$text31 = "Text 31";
$tag = date("d");
$i = 1;
while($i <= 31){
if($tag == $i){
echo"$text$i";
break;
}else{
$i++;
}
}
Kommentar