<?php
$file = "1.txt";
$contents = file($file);
$read1 = mt_rand(0,(count($contents)-1));
$line1 = $contents[$read1];
$file = "2.txt";
$contents = file($file);
$read2 = mt_rand(0,(count($contents)-1));
$line2 = $contents[$read2];
$file = "3.txt";
$contents = file($file);
$read3 = mt_rand(0,(count($contents)-1));
$line3 = $contents[$read3];
$file = "4.txt";
$contents = file($file);
$read4 = mt_rand(0,(count($contents)-1));
$line4 = $contents[$read4];
$file = "5.txt";
$contents = file($file);
$read5 = mt_rand(0,(count($contents)-1));
$line5 = $contents[$read5];
$file = "6.txt";
$contents = file($file);
$read6 = mt_rand(0,(count($contents)-1));
$line6 = $contents[$read6];
$file = "7.txt";
$contents = file($file);
$read7 = mt_rand(0,(count($contents)-1));
$line7 = $contents[$read7];
$file = "8.txt";
$contents = file($file);
$read8 = mt_rand(0,(count($contents)-1));
$line8 = $contents[$read8];
$height = 75;
$width = 300;
$im = ImageCreate($width, $height);
$txt = ImageColorAllocate ($im, 0, 0, 0);
$bg = ImageColorAllocate ($im, 150, 203, 0);
ImageFill($im, 0, 0, $bg);
$text = $line1." met ".$line2." ".$line3;
ImageString($im, 2, 5, 2, "$text", $txt);
ImageString($im, 2, 5, 13, "$line4", $txt);
ImageString($im, 2, 5, 24, "$line5", $txt);
ImageString($im, 2, 5, 35, "$line6", $txt);
ImageString($im, 2, 5, 46, "$line7", $txt);
ImageString($im, 2, 5, 57, "$line8", $txt);
header ('Content-type: image/png');
ImagePng ($im);
ImageDestroy($im);
?>