本文整理汇总了PHP中Captcha::toString方法的典型用法代码示例。如果您正苦于以下问题:PHP Captcha::toString方法的具体用法?PHP Captcha::toString怎么用?PHP Captcha::toString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Captcha
的用法示例。
在下文中一共展示了Captcha::toString方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: captcha
function captcha($pattern, $left, $operator, $right)
{
if ($pattern < 1 or $pattern > 2 or ($operator < 1 or $operator > 3)) {
return "You shouldn't do this to me :(" . "\n";
}
$captcha = new Captcha($pattern, $left, $operator, $right);
return $captcha->toString();
}
示例2: buildCaptcha
function buildCaptcha()
{
$pattern = $this->randomizer->pattern();
$left = $this->randomizer->operand();
$operator = $this->randomizer->operator();
$right = $this->randomizer->operand();
$captcha = new Captcha($pattern, $left, $operator, $right);
return $captcha->toString();
}
示例3: toString
}
}
}
}
}
}
if ($operator == 1) {
$this->result = $this->result . "+";
} else {
if ($operator == 2) {
$this->result = $this->result . "-";
} else {
if ($operator == 3) {
$this->result == $this->result . "x";
}
}
}
$this->result = $this->result . $leftOperand;
}
}
}
function toString()
{
echo $this->result . "\n";
}
}
$cap1 = new Captcha(1, 2, 1, 9);
$cap1->toString();
$cap2 = new Captcha(2, 2, 1, 9);
$cap2->toString();
示例4: Captcha
function testCaptcha2111ShouldBe1PlusOne()
{
$captcha = new Captcha(2, 1, 1, 1);
$this->assertEquals("1 + One", $captcha->toString());
}
示例5: Captcha
function testResultCaptchaWhenLeftOperandIsInteger()
{
$captcha = new Captcha(2, 1, 2, 1);
$result = $captcha->toString();
$this->assertEquals("1 * One", $result);
}