note 72391 added to function.array-product
| From: | pqpqpq at wanadoo dot nl | Date: | Wed, 17 Jan 2007 12:32:43 +0000 |
| Subject: | note 72391 added to function.array-product | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-121830@lists.php.net to get a copy of this message | ||
An observation about the _use_ of array_product with primes:
$a=$arrayOfSomePrimes=(2,3,11);
// 2 being the first prime (these days)
$codeNum=array_product($a); // gives 66 (== 2*3*11)
echo "unique product(\$a) = " . array_product($a) . "\n";
The 66 can (only) be split into its original primes,
which can be transformed into their place in the row of primes (2,3,5,7,11,13,17,19...) giving
(1,2,3,4,5,6,7,8...)
The 66 gives the places {1,2,5} in the row of primes. The number "66" is unique as a code
for {1,2,5}
So you can define the combination of table-columns {1,2,5} in "66". The bigger the
combination, the more efficient in memory/transmission, the less in calculation.
----
Server IP: 194.109.193.94
Probable Submitter: 81.68.120.158
----
Manual Page -- http://www.php.net/manual/en/function.array-product.php
Edit -- https://master.php.net/note/edit/72391
Del: integrated -- https://master.php.net/note/delete/72391/integrated
Del: useless -- https://master.php.net/note/delete/72391/useless
Del: bad code -- https://master.php.net/note/delete/72391/bad+code
Del: spam -- https://master.php.net/note/delete/72391/spam
Del: non-english -- https://master.php.net/note/delete/72391/non-english
Del: in docs -- https://master.php.net/note/delete/72391/in+docs
Del: other reasons-- https://master.php.net/note/delete/72391
Reject -- https://master.php.net/note/reject/72391
Search -- https://master.php.net/manage/user-notes.php