Advertisement
GWibisono

captcha

Aug 15th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.17 KB | None | 0 0
  1. <?php
  2.     $captcha=rand(1,15);
  3.     $num1=rand(1,10);
  4.     $num2=$captcha - $num1;
  5.     $operator=$num2>0?"+":"-";
  6.     $num2=abs($num2);
  7.  
  8. echo "{$num1}{$operator}{$num2} = {$captcha}";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement