note 74487 added to function.rand
| From: | Tribal_X at no_mail dot com | Date: | Fri, 13 Apr 2007 13:19:54 +0000 |
| Subject: | note 74487 added to function.rand | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125362@lists.php.net to get a copy of this message | ||
If you ever need a function in order to do a random math use this (i use it in my captcha script)
<?php
function Random_Math($length)
{
$p = "-+/*"; //the values
for($i=0;$i<$length;$i++)
{
$output = $p {rand(0,3)};
}
return $output;
}
?>
----
Server IP: 83.137.20.120
Probable Submitter: 62.194.220.28
----
Manual Page -- http://www.php.net/manual/en/function.rand.php
Edit -- https://master.php.net/note/edit/74487
Del: integrated -- https://master.php.net/note/delete/74487/integrated
Del: useless -- https://master.php.net/note/delete/74487/useless
Del: bad code -- https://master.php.net/note/delete/74487/bad+code
Del: spam -- https://master.php.net/note/delete/74487/spam
Del: non-english -- https://master.php.net/note/delete/74487/non-english
Del: in docs -- https://master.php.net/note/delete/74487/in+docs
Del: other reasons-- https://master.php.net/note/delete/74487
Reject -- https://master.php.net/note/reject/74487
Search -- https://master.php.net/manage/user-notes.php