$foo = strip_tags($_GET["text"]); if (strlen($foo) == 0) { $foo = exec("lynx --source https://www.wikihow.com/Special:Randomizer?? | grep \"\" | awk '{gsub(\"<[^>]*>\", \"\")}1' | sed 's/How to//g' | sed 's/(with Pictures)//g' | sed 's/ - wikiHow//g' | sed -e 's/^[[:space:]]*//'"); } //Set the Content Type header('Content-type: image/png'); // Create Image From Existing File $png_image = imagecreatefrompng('april.png'); // Allocate A Color For The Text $white = imagecolorallocate($png_image, 255, 255, 255); // Set Path to Font File $font_path = './nes.ttf'; // Set Text to Be Printed On Image $text = strtoupper($foo); if(strlen($text >= 20)){ $text = substr($text, 0, 20); } $text = wordwrap($text, 15, "\n\n"); $text = $text . "."; // Print Text On Image imagettftext($png_image, 12, 0, 20, 42, $white, $font_path, $text); // Send Image to Browser imagepng($png_image); // Clear Memory imagedestroy($png_image); ?>