1. Go to this page and download the library: Download joby/toolbox 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/ */
joby / toolbox example snippets
use Joby\Toolbox\Strings\Encoding;
// encode a string or binary data
$encoded = Encoding::base64url_encode($your_data);
// decode it
$decoded = Encoding::base64_url_decode($encoded);
// Create a sorter with multiple criteria
$sorter = new Sorter(
fn ($a, $b) => $a->priority <=> $b->priority,
fn ($a, $b) => $a->name <=> $b->name
);
// Sort multiple arrays with the same criteria
$sorter->sort($array1);
$sorter->sort($array2);
class MyClass implements Sortable {
public function sortByValue(): string|int|float|bool {
return $this->priority;
}
}
// Example using IntegerRange implementation
$range1 = new IntegerRange(1, 5);
$range2 = new IntegerRange(3, 8);
// Intersection (AND)
$intersection = $range1->booleanAnd($range2); // Range from 3 to 5
// Union (OR)
$union = $range1->booleanOr($range2); // Collection with range from 1 to 8
// Exclusive OR
$xor = $range1->booleanXor($range2); // Collection with ranges 1-3 and 5-8
// Create a collection of ranges
$collection = RangeCollection::create($range1, $range2);
// Merge overlapping and adjacent ranges
$merged = $collection->mergeRanges();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.