note 93365 added to function.array-pop
| From: | jim203nospamplz at plznospamaol dot com | Date: | Sat, 05 Sep 2009 23:51:33 +0000 |
| Subject: | note 93365 added to function.array-pop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-160248@lists.php.net to get a copy of this message | ||
2 line changes to my previous submission:
$theJumpNumber = (round(count($temparray)/2) + $startingFileNumber) % count($temparray); // use of
startingfilenumber randomizes the jump number
while (count($temparray) % $theJumpNumber == 0
|| !isPrime($theJumpNumber)) // !isPrime as easy way to check for no cofactors
You need to check for no cofactors so you can cycle round the complete array without duplicates.
Checking !isPrime on theJumpNumber is a pretty easy way to do that. isPrime can be found by google:
php isprime
----
Server IP: 208.69.120.35
Probable Submitter: 89.195.131.202
----
Manual Page -- http://www.php.net/manual/en/function.array-pop.php
Edit -- https://master.php.net/note/edit/93365
Del: integrated -- https://master.php.net/note/delete/93365/integrated
Del: useless -- https://master.php.net/note/delete/93365/useless
Del: bad code -- https://master.php.net/note/delete/93365/bad+code
Del: spam -- https://master.php.net/note/delete/93365/spam
Del: non-english -- https://master.php.net/note/delete/93365/non-english
Del: in docs -- https://master.php.net/note/delete/93365/in+docs
Del: other reasons-- https://master.php.net/note/delete/93365
Reject -- https://master.php.net/note/reject/93365
Search -- https://master.php.net/manage/user-notes.php