本文整理汇总了PHP中Captcha::result方法的典型用法代码示例。如果您正苦于以下问题:PHP Captcha::result方法的具体用法?PHP Captcha::result怎么用?PHP Captcha::result使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Captcha
的用法示例。
在下文中一共展示了Captcha::result方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: fixCaptcha
/**
* Obsługa DBC - rozwiązywanie captcha
* @param string $captchaUrl
*/
public static function fixCaptcha($captchaUrl)
{
$captchaFile = dirname(__FILE__) . '/captcha/' . uniqid('captcha') . '.png';
file_put_contents($captchaFile, PlayMobile::curl($captchaUrl));
if (PlayMobile::$captchaService == 'deathbycaptcha.com') {
require_once 'vendor/deathbycaptcha.php';
$client = new DeathByCaptcha_SocketClient(PlayMobile::$dbcUser, PlayMobile::$dbcPass);
$captcha = $client->decode($captchaFile, DeathByCaptcha_Client::DEFAULT_TIMEOUT);
$captcha = $captcha['text'];
} else {
require_once 'vendor/Captcha.php';
$client = new Captcha();
$client->domain = PlayMobile::$captchaService;
$client->setApiKey(PlayMobile::$captchaApiKey);
if ($client->run($captchaFile)) {
$captcha = $client->result();
} else {
$captcha = NULL;
}
}
if ($captcha) {
@unlink($captchaFile);
print "Captcha: {$captcha}\n";
return $captcha;
} else {
@unlink($captchaFile);
return FALSE;
}
}
示例2: Captcha
<?php
require_once "random.php";
require_once "Captcha.php";
$Captcha = new Captcha();
$Captcha->generate(new Random());
echo $Captcha->result() . "\n";