Using a custom style
<?php

    define
("WIDTH"450);
    
define("HEIGHT"450);

    
$img imagecreate(WIDTHHEIGHT);
    
    
$background $white imagecolorallocate($img0xFF0xFF0xFF);
    
$black imagecolorallocate($img000);
    
    
imagerectangle($img00WIDTH-1HEIGHT-1$black);
    
    
/* Define Style arrays */
    
$dashed = array($black$black$black$white$white$white);
    
$sos = array($black$black,
                    
$white$white
                    
$black$black,
                    
$white$white,                    /* . . . */
                    
$black$black,
                    
$white$white,

                    
$black$black$black$black,
                    
$white$white
                    
$black$black$black$black,    /* - - - */
                    
$white$white
                    
$black$black$black$black,
            
                    
$white$white,
                    
$black$black,
                    
$white$white,                    /* . . . */
                    
$black$black,
                    
$white$white,
                    
$black$black,

                    
$white$white,$white$white,$white$white);

    
imagesetstyle($img$sos);
    
    
imageline($img00WIDTH-1HEIGHT-1IMG_COLOR_STYLED);
    
imageline($img0HEIGHT-1WIDTH-10IMG_COLOR_STYLED);

    
imagesetstyle($img$dashed);
    
imagerectangle($img3030WIDTH-31HEIGHT-31IMG_COLOR_STYLED);
    
imagerectangle($img5050WIDTH-51HEIGHT-51$black);
    
    
header("Content-Type: image/png");
    
imagepng($img);

?>