Pasta: e6f89ebd7093fecceb0ebe88cf58e48f402c16e3 (2014-08-11)

Język: PHP
Adres: p43.pl/p,e6f89ebd7093fecceb0ebe88cf58e48f402c16e3
Ilość linii: 66
Rozmiar: 1.08 kB
Wyświetleń: 429
Ostatnio użyto: 2017-09-18 21:41:59
<?php // Create a new image instance $im = imagecreatetruecolor(100, 100); // Do some image operations here // Handle output if(function_exists('imagegif')) { // For GIF header('Content-Type: image/gif'); imagegif($im); } elseif(function_exists('imagejpeg')) { // For JPEG header('Content-Type: image/jpeg'); imagejpeg($im, NULL, 100); } elseif(function_exists('imagepng')) { // For PNG header('Content-Type: image/png'); imagepng($im); } elseif(function_exists('imagewbmp')) { // For WBMP header('Content-Type: image/vnd.wap.wbmp'); imagewbmp($im); } else { imagedestroy($im); die('No image support in this PHP server'); } // If image support was found for one of these // formats, then free it from memory if($im) { imagedestroy($im); } ?> <pre> This is a test </pre> <div style="text-align:center;">Another one</div> <?php if(imagetypes() & IMG_GIF) { header('Content-Type: image/gif'); imagegif($im); } elseif(imagetypes() & IMG_JPG) { /* ... etc. */ } ?>