Recommend this page to a friend! |
Download |
Info | Documentation | Files | Install with Composer | Download | Reputation | Support forum | Blog | Links |
Ratings | Unique User Downloads | Download Rankings | ||||
Not enough user ratings | Total: 113 | All time: 9,598 This week: 206 |
Version | License | PHP version | Categories | |||
arrayintersections 1.0 | GNU General Publi... | 5 | Algorithms, PHP 5, Tools |
Description | Author | |
This class can find intersections between combinations of arrays. |
Tries to find intersections between a combination of arrays.
use Jelle_S\Util\Intersections\ArrayIntersections;
// Get all possible intersections, where the minimum array size of an
// intersection is 3.
$arrays = array(
array(
'a' => 1,
'b' => 2,
'c' => 3,
'd' => 4,
'e' => 9,
),
array(
'a' => 1,
'b' => 2,
'c' => 3,
'e' => 9,
),
array(
'a' => 1,
'b' => 42,
'c' => 3,
'd' => 4,
),
array(
'b' => 42,
'c' => 3,
'a' => 1,
),
array(
'z' => 26,
'e' => 9,
'a' => 1,
),
);
$intersections = new Jelle_S\Util\Intersections\ArrayIntersections($arrays, 3);
print_r($intersections->getAll());
print_r($intersections->getLargest());
Output:
Array
(
[2] => Array
(
[a] => 1
[b] => 2
[c] => 3
[e] => 9
)
[1] => Array
(
[a] => 1
[c] => 3
[d] => 4
)
[0] => Array
(
[a] => 1
[b] => 42
[c] => 3
)
)
Array
(
[a] => 1
[b] => 2
[c] => 3
[e] => 9
)
Files (8) |
File | Role | Description | ||
---|---|---|---|---|
src (1 file) | ||||
tests (1 file) | ||||
.codeclimate.yml | Data | Auxiliary data | ||
.travis.yml | Data | Auxiliary data | ||
composer.json | Data | Auxiliary data | ||
LICENSE | Lic. | License text | ||
phpunit.xml | Data | Auxiliary data | ||
README.md | Doc. | Documentation |
The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page. |
Install with Composer |
arrayintersections-2017-01-12.zip 16KB | |
arrayintersections-2017-01-12.tar.gz 15KB | |
Install with Composer |
Needed packages | ||
Class | Download | Why it is needed | Dependency |
---|---|---|---|
PHP BitMask Generator | .zip .tar.gz | Composer dependency. | Required |
Version Control | Reuses | Unique User Downloads | Download Rankings | ||||||||||||||||
100% | 1 |
|
|
Applications that use this package |
If you know an application of this package, send a message to the author to add a link here.
Other classes that need this package |
Class | Why it is needed | Dependency |
---|---|---|
PHP Array Key Combiner | Composer dependency. | Required |