Flood fill in PHP
Description
The following code shows how to flood fill.
Example
<?php// w w w . ja v a 2 s .co m
$im = imagecreatetruecolor(100, 100);
// sets background to red
$red = imagecolorallocate($im, 255, 0, 0);
imagefill($im, 0, 0, $red);
header('Content-type: image/png');
imagepng($im);
imagedestroy($im);
?>
The code above generates the following result.