当前位置: 首页>>代码示例>>PHP>>正文


PHP Captcha::toString方法代码示例

本文整理汇总了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();
}
开发者ID:kintawamaiyo,项目名称:PhpSkeleton,代码行数:8,代码来源:captcha.php

示例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();
 }
开发者ID:kintawamaiyo,项目名称:PhpSkeleton,代码行数:9,代码来源:CaptchaController.php

示例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();
开发者ID:atanin,项目名称:PhpSkeleton,代码行数:30,代码来源:captcha.php

示例4: Captcha

 function testCaptcha2111ShouldBe1PlusOne()
 {
     $captcha = new Captcha(2, 1, 1, 1);
     $this->assertEquals("1 + One", $captcha->toString());
 }
开发者ID:kintawamaiyo,项目名称:PhpSkeleton,代码行数:5,代码来源:CaptchaTest.php

示例5: Captcha

 function testResultCaptchaWhenLeftOperandIsInteger()
 {
     $captcha = new Captcha(2, 1, 2, 1);
     $result = $captcha->toString();
     $this->assertEquals("1 * One", $result);
 }
开发者ID:roongr2k7,项目名称:confusing-captcha,代码行数:6,代码来源:CaptchaTest.php


注:本文中的Captcha::toString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。