J'ai des problèmes avec la production d'un rectangle avec GD - PHP. Je cours XAMPP et la programmation sur Netbeans IDE. Je suis nouveau à PHP, mais quelques-uns ce qui est similaire à Perl.Erreur d'encodage graphique PHP
<?php
header ("Content-type: image/png");
$newImg = ImageCreate(250,250);
$red = ImageColorAllocate($newImg,255,0,0);
ImageFill($newImg,0,0,$red);
ImagePNG($newImg);
ImageDestroy($newImg);
?>
Voici la sortie.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title></title>
</head>
<body>
‰PNG
IHDRúú²"È~PLTEˆÁÿ·¿~`IDAThíÁ‚ ÿ¯[email protected]¿ :F¨z’IEND®B`‚ </body>
</html>