function for imagefilledrectangle with rounded corners
<p>I'm willing to create an image with certain text using the following code</p>

<pre><code>&lt;?PHP
header('Content-Type: image/png');

$im = imagecreatetruecolor(320, 80);

$blue = imagecolorallocate($im, 59, 89, 152);
$sky = imagecolorallocate($im, 219, 241, 255);

imagefilledrectangle($im, 0, 0, 399, 79, $sky);

$font = 'arial.ttf';

$text = "Hello world"; 

imagettftext($im, 15, 0, 10, 20, $blue, $font, $text); 
imagepng($im);
imagedestroy($im);
?&gt;
</code></pre>

<p>Now the out put will be as following image</p>

<p>this is rectangle</p>

<p><img src="http://i.stack.imgur.com/IFAcI.png" alt="rectangle image"></p>

<p><strong>Now</strong>
What if i want to made to it a rounded corner 
by refer to php manual about <a href="http://php.net/manual/en/function.imagefilledrectangle.php" rel="nofollow">function imagefilledrectangle</a> I've found a good comment with function said to be able to make it rounded corner</p>

<pre><code>&lt;?

function ImageRectangleWithRoundedCorners(&amp;$im, $x1, $y1, $x2, $y2, $radius, $color)
{
// draw rectangle without corners
imagefilledrectangle($im, $x1+$radius, $y1, $x2-$radius, $y2, $color);
imagefilledrectangle($im, $x1, $y1+$radius, $x2, $y2-$radius, $color);
// draw circled corners
imagefilledellipse($im, $x1+$radius, $y1+$radius, $radius*2, $radius*2, $color);
imagefilledellipse($im, $x2-$radius, $y1+$radius, $radius*2, $radius*2, $color);
imagefilledellipse($im, $x1+$radius, $y2-$radius, $radius*2, $radius*2, $color);
imagefilledellipse($im, $x2-$radius, $y2-$radius, $radius*2, $radius*2, $color);
}

?&gt;
</code></pre>

<p>But didn't mention how to use ! ~ anyhelp</p>
