是这样的,今天按着网上的资料写了一个PHP生成验证码的模板:
可是我不想让他直接输出图片,而是以base64输出图片,请问该如何做?自己试了很多方法都不成功,除非必须这样:
$img_file = 'https://www.xxxxxxxxxx.com/authcode.php';
$img_info = getimagesize($img_file);
$img_src = "data:{$img_info['mime']};base64," . base64_encode(file_get_contents($img_file));
echo "
";
请问如何在getCode中就直接输出base64呢?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
小伙看你根骨奇佳,潜力无限,来学PHP伐。