example starts at row 0

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@166575 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2004-08-17 09:55:35 +00:00
parent 7088521493
commit 67e076a26f

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.21 $ -->
<!-- $Revision: 1.22 $ -->
<reference id="ref.image">
<title>Image Functions</title>
<titleabbrev>Image</titleabbrev>
@ -168,14 +168,16 @@
<programlisting role="php">
<![CDATA[
<?php
header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);
header("Content-type: image/png");
$string = $_GET['text'];
$im = imagecreatefrompng("images/button1.png");
$orange = imagecolorallocate($im, 220, 210, 60);
$px = (imagesx($im) - 7.5 * strlen($string)) / 2;
imagestring($im, 3, $px, 9, $string, $orange);
imagepng($im);
imagedestroy($im);
?>
]]>
</programlisting>