PHPackages                             efureev/uphp - 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. efureev/uphp

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

efureev/uphp
============

u.php useful fn collection &amp; snippets

2.0.2(8y ago)015MITPHPPHP &gt;=5.6

Since Sep 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/efureev/u.php)[ Packagist](https://packagist.org/packages/efureev/uphp)[ Docs](https://github.com/efureev/u.php)[ RSS](/packages/efureev-uphp/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (4)Dependencies (2)Versions (3)Used By (0)

u.php
=====

[](#uphp)

*utilites4php*

[![GitHub version](https://camo.githubusercontent.com/68cef602903acce853e8d815bd9c0ea9bacf428ee9f71893f7db809229c54ed7/68747470733a2f2f62616467652e667572792e696f2f67682f65667572656576253246752e7068702e737667)](https://badge.fury.io/gh/efureev%2Fu.php) [![Build Status](https://camo.githubusercontent.com/699871a1b9bd096c82a0e7a5995e2d74f84e6083c1b5be579d57332dccd63db8/68747470733a2f2f7472617669732d63692e6f72672f656675726565762f752e7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/efureev/u.php) [![Dependency Status](https://camo.githubusercontent.com/4940885f36101a44c8772b4cd185abec39bf1c270fd518d2b4117568e2a9e622/68747470733a2f2f67656d6e617369756d2e636f6d2f6261646765732f6769746875622e636f6d2f656675726565762f752e7068702e737667)](https://gemnasium.com/github.com/efureev/u.php) [![](https://camo.githubusercontent.com/0fe7ea61b89a900a38e174ce5ca12bd46325ec07b9a0bf4d0aba229a33dbb612/68747470733a2f2f7265706f73732e6865726f6b756170702e636f6d2f3f706174683d656675726565762f752e706870)](https://camo.githubusercontent.com/0fe7ea61b89a900a38e174ce5ca12bd46325ec07b9a0bf4d0aba229a33dbb612/68747470733a2f2f7265706f73732e6865726f6b756170702e636f6d2f3f706174683d656675726565762f752e706870) [![Code Climate](https://camo.githubusercontent.com/5d92b4e6c34d3c00cc28609cfa029502718491a99a4b31c09dcdc896fed3a78a/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f656675726565762f752e7068702f6261646765732f6770612e737667)](https://codeclimate.com/github/efureev/u.php) [![Test Coverage](https://camo.githubusercontent.com/e65515ad88aa7054a8fe6c4ce9c1fdaf88577629ec0fa152bb0011b7e9a4ba52/68747470733a2f2f636f6465636c696d6174652e636f6d2f6769746875622f656675726565762f752e7068702f6261646765732f636f7665726167652e737667)](https://codeclimate.com/github/efureev/u.php/coverage)

Run Tests Example
=================

[](#run-tests-example)

run all test: `phpunit`run test unit: `phpunit tests/BaseTest`

Send the coverage data to Code Climate
======================================

[](#send-the-coverage-data-to-code-climate)

CODECLIMATE\_REPO\_TOKEN= {token} ./vendor/bin/test-reporter

Functions
=========

[](#functions)

uFile
-----

[](#ufile)

- getExt *Return File Extension*`getExt($filename)`

```
uFile::getExt('/var/log/error.log');
uFile::size('/var/log/error.log');
uFile::size('/var/log/error.log', false);
uFile::sizeFormat(323423);
```

uList
-----

[](#ulist)

- rangeList *Return range integer list*`rangeList($from, $to, $step = 1)`

```
uList::rangeList(1,4); // 1,2,3,4
uList::rangeList(1,50, 10); // 10,20,30,40,50
uList::rangeList(10, 7); // 10,9,8,7
```

uTime
-----

[](#utime)

- timeList *Return time list*`timeList($minutes = 30)`

```
uTime::timeList();
uTime::timeList(60);
```

uColor
------

[](#ucolor)

- hex2RGB *HEX to RGB*`hex2RGB($hexStr, $returnAsString = false, $separator = ',')`

```
uColor::hex2RGB('00FF00', 1) // '0,255,0'
uColor::hex2RGB('000', 1) // '0,0,0'
uColor::hex2RGB('000', 1,'|') // '0|0|0'
uColor::hex2RGB('000') // ['red' => 0,'green' => 0,'blue' => 0]
```

uArray
------

[](#uarray)

- isAssociative *Associative array or not*`uArray::isAssociative($array, $allStrings = true)`
- isIndexed *Indexed array or not*`uArray::isAssociative($array, $allStrings = true)`
- clean *Remove empty values from array: FALSE, 0, '0', '', null*`uArray::clean(array $array)`
- removeValue *Remove from array by value*`uArray::removeValue(array $array, $arg, $arg2, ..n)`
- exists *Checks if the given key exists in the array by a string representation*`uArray::exists($key, $array)`

```
$data = [
    'k0' => 'v0',
    'k1' => [
        'k1-1' => 'v1-1'
    ],
    'complex_[name]_!@#$&%*^' => 'complex',
    'k2' => 'string'
];
Arrays::exists('k0', $data); // returns: true
Arrays::exists('k9', $data); // returns: false
Arrays::exists('[k1][k1-1]', $data); // returns: true
Arrays::exists('[k1][k1-2]', $data); // returns: false
Arrays::exists('["complex_[name]_!@#$&%*^"]', $data); // returns: true
Arrays::exists('[k2][2]', $data); // returns: false
```

- save *Save element to the array by a string representation*`uArray::save($key, &$array, $value, $replace = true)`

```
$data = [
    'k2' => 'string'
];

Arrays::save('k0', $data, 'v0'); // returns: true, save as 'k0' => 'v0'
Arrays::save('[k1][k1-1]', $data, 'v1-1'); // returns: true, save as 'k1' => ['k1-1' => 'v1-1']
Arrays::save('[k2][2]', $data, 'p'); // returns: false, can't save value to string

// Broken key names
Arrays::save('k3[', $data, 'v3'); // returns: false, can't save, bad syntax
Arrays::save('["k4["]', $data, 'v4'); // returns: true, save as 'k4[' => 'v4'
Arrays::save('"k4["', $data, 'v4'); // returns: false, can't save, bad syntax

// Append
Arrays::save('k5', $data, []); // returns: true, create array 'k5' => []
Arrays::save('k5[]', $data, 'v5-0'); // returns: true, append value to exists array 'k5' => [ 'v5-0' ]
Arrays::save('k6[k6-1][]', $data, 'v6-1-0'); // returns: true, save as 'k6' => [ 'k6-1' => [ 'v6-1-0' ] ]

// Replace if not exists
Arrays::save('k2', $data, 'something', false); // returns false, value not replaced because value is exists
```

- delete *Delete element from the array by a string representation*`uArray::delete($key, &$array)`

```
$data = [
    'k0' => 'v0',
    'k1' => [
        'k1-1' => 'v1-1'
    ],
    'complex_[name]_!@#$&%*^' => 'complex'
];

Arrays::delete('k0', $data); // returns: true, delete element from array
Arrays::delete('k9', $data); // returns: false

Arrays::delete('[k1][k1-1]', $data); // returns: true, delete element from array
Arrays::delete('[k1][k1-2]', $data); // returns: false

Arrays::delete('["complex_[name]_!@#$&%*^"]', $data); // returns: true, delete element from array
```

- get *Get element of the array by a string representation*`uArray::get($key, $array, $default = null, $ignoreString = true)`

```
$data = [
    'k0' => 'v0',
    'k1' => [
        'k1-1' => 'v1-1'
    ],
    'complex_[name]_!@#$&%*^' => 'complex',
    'k2' => 'string'
];

Arrays::get('k0', $data); // returns: 'v0'
Arrays::get('k9', $data, '0'); // returns: '0', key isn't exists in array

Arrays::get('[k1][k1-1]', $data); // returns: 'v1-1'
Arrays::get('[k1][k1-2]', $data, 'default'); // returns: 'default', key isn't exists in array

Arrays::get('["complex_[name]_!@#$&%*^"]', $data); // returns: 'complex'

Arrays::get('[k2][2]', $data); // returns: null, key isn't exists in array

// If you want get a symbol from string value, you may switch off option $ignoreString = false
Arrays::get('[k2][2]', $data, null, false); // returns: 'r'
Arrays::get('[k2][null]', $data, null, false); // returns: null, offset isn't exists in string
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 83.3% 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

Every ~513 days

Total

2

Last Release

3004d ago

PHP version history (2 changes)2.0.0PHP &gt;=5.4

2.0.2PHP &gt;=5.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/62a6e061d1ccab4d5de8dcba717b7634f91e4842b32ca26420b8261c66104bf7?d=identicon)[efureev](/maintainers/efureev)

---

Top Contributors

[![efureev](https://avatars.githubusercontent.com/u/5524684?v=4)](https://github.com/efureev "efureev (25 commits)")[![feugene](https://avatars.githubusercontent.com/u/3530903?v=4)](https://github.com/feugene "feugene (5 commits)")

---

Tags

phputilityhelpers

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/efureev-uphp/health.svg)

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

###  Alternatives

[brandonwamboldt/utilphp

util.php is a collection of useful functions and snippets that you need or could use every day, designed to avoid conflicts with existing projects

1.0k538.8k12](/packages/brandonwamboldt-utilphp)[transprime-research/piper

PHP Pipe method execution with values from chained method executions

174.6k2](/packages/transprime-research-piper)

PHPackages © 2026

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