BasicCaptchaImage example

imagettftext($img, 45, 0, 80, 55, $codeColor$this->fontPath, $code);
        } else {
            imagestring($img, 5, 100, 20, $code$codeColor);
        }

        ob_start();
        imagepng($img, null, 9);
        $image = (string) ob_get_clean();
        imagedestroy($img);
        $image = base64_encode($image);

        return new BasicCaptchaImage($code$image);
    }

    public function setBackgroundPath(string $path): void
    {
        $this->backgroundPath = $path;
    }

    public function getBackgroundPath(): string
    {
        return $this->backgroundPath;
    }

    
Home | Imprint | This part of the site doesn't use cookies.