suchen

Heim  >  Fragen und Antworten  >  Hauptteil

Problem mit der Schleifenzuordnung?

http://www.php.cn/code/5179.html

In diesem Tutorial werden die Informationen aus der for-Schleife der Sitzung zugewiesen, sodass nach der Schleife nur eine Zahl erhalten wird;


for($ i=0;$i<4;$i++){
$color=imagecolorallocate($image,rand(0,255),rand(0,255),rand(0,255));
$x=100/4* $i+7 ;
$y=rand(0,20);
$size=6;
$content=rand(0,9);
$yzxx="$content";
imagestring($image,$size ,$x, $y,$content,$color);
}
$_SESSION['yzxx']=$yzxx;
var_dump($_SESSION);

杜文涛杜文涛2680 Tage vor1280

Antworte allen(1)Ich werde antworten

  • 路过

    路过2017-10-10 16:30:08

    $yzxx .= "$content"; 你的等号前面少了个“.”

    Antwort
    1
  • 杜文涛

    谢谢了 新手不太会

    杜文涛 · 2017-10-10 19:35:48
    杜文涛

    看了下教程 教程里都写错了吧

    杜文涛 · 2017-10-10 19:40:29
    路过

    谁不是从新手过来的呢?加油

    路过 · 2017-10-11 08:41:45
  • StornierenAntwort