PHP code example of meniam / permutation
1. Go to this page and download the library: Download meniam/permutation library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
meniam / permutation example snippets
$permutation = new Permutation(3);
foreach ($i = 0; $i <= $permutation->count(); $i++) {
var_dump($permutation->current()); // array like [0, 1, 2] or [2, 1, 0]
$permutation->next();
}
var_dump($permutation->getByPos('Some Unique Hash Or Integer'));