private static function errorImage($statusCode, $message, $output)
    {
        $size = 200;
        $image = imagecreatetruecolor($size, $size);
        $textColor = imagecolorallocate($image, 255, 255, 255);
        imagestring($image, 5, 10, 10, "Error {$statusCode}", $textColor);

        foreach (str_split($message, intval($size / 10)) as $line => $text) {
            imagestring($image, 5, 10, ($line * 18) + 28, $text, $textColor);
        }

        ob_start();
        $output($image);

        return ob_get_clean();
    }
private static function errorImage($statusCode, $message, $output)
    {
        $size = 200;
        $image = imagecreatetruecolor($size, $size);
        $textColor = imagecolorallocate($image, 255, 255, 255);
        imagestring($image, 5, 10, 10, "Error {$statusCode}", $textColor);

        foreach (str_split($message, intval($size / 10)) as $line => $text) {
            imagestring($image, 5, 10, ($line * 18) + 28, $text, $textColor);
        }

        ob_start();
        $output($image);

        return ob_get_clean();
    }
private static function errorImage ( $ statusCode , $ message , $ output ) { $ size = 200 ; $ image = imagecreatetruecolor ( $ size , $ size ) ; $ textColor = imagecolorallocate ( $ image , 255 , 255 , 255 ) ; imagestring ( $ image , 5 , 10 , 10 , "Error {$statusCode}" , $ textColor ) ; foreach ( str_split ( $ message , intval ( $ size / 10 ) ) as $ line => $ text ) { imagestring ( $ image , 5 , 10 , ( $ line * 18 ) + 28 , $ text , $ textColor ) ; } ob_start ( ) ; $ output ( $ image ) ; return ob_get_clean ( ) ; }
Print the error as image.

@param int    $statusCode
@param string $message
@param string $output

@return string
Print the error as image .