How drawing using PHP?
Posted: Wed Nov 13, 2002 1:57 am
Help!
Please, if know write how drawing the diagram?

Please, if know write how drawing the diagram?

A community of PHP developers offering assistance, advice, discussion, and friendship.
http://forums.devnetwork.net/
Code: Select all
<?php
$y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50;
$y2 = (isset($_GETї'endY']))?$_GETї'endY'] : 50;
$img = imagecreate(100,100);
$color = imagecolorallocate ($img, 200, 200, 200);
imagerectangle($img, 0,0,99,99, $color);
$color = imagecolorallocate ($img, 255, 0, 0);
imageline($img, 0, $y1, 99, $y2, $color);
header('Content-type: image/png');
imagepng($img);
?>
What does "?" and ":" mean?volka wrote:Code: Select all
<?php $y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50; $y2 = (isset($_GETї'endY']))?$_GETї'endY'] : 50; ?>
Code: Select all
$y1 = (isset($_GETї'startY']))?$_GETї'startY'] : 50;
Code: Select all
if (isset($_GETї'startY'])) {
$y1 = $_GETї'startY'];
} else {
$y1 = 50;
}