PHPackages                             lablnet/dshandler - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lablnet/dshandler

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lablnet/dshandler
=================

PHP DataStructure.

1.0(6y ago)24MITPHP

Since Jan 22Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Lablnet/DSHandler)[ Packagist](https://packagist.org/packages/lablnet/dshandler)[ RSS](/packages/lablnet-dshandler/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

PHP DataStructure Handler
=========================

[](#php-datastructure-handler)

##### This package can manipulate data structures.

[](#this-package-can-manipulate-data-structures)

Requirement
-----------

[](#requirement)

1. PHP
2. Composer

Installation
------------

[](#installation)

Installing this package is very simple, first ensure you have the right PHP version and composer installed then in your terminal/(command prompt) run: `composer require lablnet/dshandler:dev-master`

Feature
-------

[](#feature)

1. Sort multi dimessional array based on column.
2. Remove duplicate array base on key
3. Remove array, base on key:value pair.

TODO
----

[](#todo)

\[ \] Allow to specificy range on remove array: - Like we should able to say, remove products below rating 3...

Usage
-----

[](#usage)

Consider the following dataset

```
$products = [
	[
		'id' => 1,
		'name' => 'Test 1',
		'price' => 300,
		'rating' => 4.5
	],
	[
		'id' => 2,
		'name' => 'Test 2',
		'price' => 600,
		'rating' => 4.1
	],
	[
		'id' => 3,
		'name' => 'Test 3',
		'price' => 150,
		'rating' => 3.1
	],
	[
		'id' => 4,
		'name' => 'Test 4',
		'price' => 700,
		'rating' => 5
	],
	[
		'id' => 5,
		'name' => 'Test 5',
		'price' => 900,
		'rating' => 2.9
	],
	[
		'id' => 6,
		'name' => 'Test 5',
		'price' => 265,
		'rating' => 2.9
	]
];
```

Initialise the classs

```
require_once "../vendor/autoload.php";

$handler = new Lablnet\DSHandler();
```

1. Remove array/products by key:value

```
//remove array by key:value
$handler->_remove($products, 'rating', 2.9);
echo "Remove array by key:value";
print_r($products);
echo "";
echo "";
```

2. Remove duplicate array by key

```
//remove duplicate array by key
$unique = $handler->_unique($products, 'name');
echo "Remove duplicate value by key";
print_r($unique);
echo "";
echo "";
```

3. Sort the products base on price

```
//Now sort the products base on price
$sort_1_price = $products;
$handler->_sort($sort_1_price, 'price', SORT_ASC);
echo "Sort by price ASC";
print_r($sort_1_price);
echo "";
echo "";
$sort_2_price = $products;
$handler->_sort($sort_2_price, 'price', SORT_DESC);
echo "Sort by price DESC";
print_r($sort_2_price);
echo "";
echo "";
```

4. Sort the products based on rating

```
//Now sort the product base on rating
$sort_1_rating = $products;
$handler->_sort($sort_1_rating, 'rating', SORT_ASC);
echo "Sort by Rating ASC";
print_r($sort_1_rating);
echo "";
echo "";
$sort_2_rating = $products;
$handler->_sort($sort_2_rating, 'rating', SORT_DESC);
echo "Sort by Rating DESC";
print_r($sort_2_rating);
echo "";
echo "";
```

Example
-------

[](#example)

The example file is distrubuted with this package.

License
-------

[](#license)

This package is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

Questions
---------

[](#questions)

If you have any question feel free to ask me

###  Health Score

25

—

LowBetter than 35% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

2353d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/aaa321ed1bec9048a01ab2d3adcfca294a6382180fcce5fd98ddd97f52814d3c?d=identicon)[lablnet](/maintainers/lablnet)

---

Top Contributors

[![lablnet](https://avatars.githubusercontent.com/u/27757785?v=4)](https://github.com/lablnet "lablnet (3 commits)")

---

Tags

arrayclasssdatadata-structuredshandlerelementfreehandlerhandlersmitopen-sourcephpremovesortuniquephparraypackagedatafreeLablnet

### Embed Badge

![Health badge](/badges/lablnet-dshandler/health.svg)

```
[![Health](https://phpackages.com/badges/lablnet-dshandler/health.svg)](https://phpackages.com/packages/lablnet-dshandler)
```

###  Alternatives

[hi-folks/data-block

Data class for managing nested arrays and JSON data.

1462.9k](/packages/hi-folks-data-block)[iteks/laravel-enum

A comprehensive Laravel package providing enhanced enum functionalities, including attribute handling, select array conversions, and fluent facade interactions for robust enum management in Laravel applications.

2518.6k](/packages/iteks-laravel-enum)[lablnet/encryption

PHP Encryption package.

133.1k3](/packages/lablnet-encryption)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
