In this tutorial, the information from the for loop is assigned to the session, and the information is looped out like this Only one number is obtained;
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);
$yzxx .= "$content"; You are missing a "." in front of the equal sign