PHPackages                             creativestyle/utilities - 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. creativestyle/utilities

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

creativestyle/utilities
=======================

Static method utilities collection with high reusability

v3.0.1(7y ago)31.2k↑249.2%11MITPHPPHP &gt;=7.1

Since Oct 27Pushed 7y ago3 watchersCompare

[ Source](https://github.com/creativestyle/php-utilities)[ Packagist](https://packagist.org/packages/creativestyle/utilities)[ RSS](/packages/creativestyle-utilities/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (6)Used By (1)

[![Build Status](https://camo.githubusercontent.com/ad5c173bb5ac9fad2c7182644f7ff643348045f6fbcd03b461231ffb5b72464f/68747470733a2f2f7472617669732d63692e6f72672f63726561746976657374796c652f7068702d7574696c69746965732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/creativestyle/php-utilities)

Common PHP Utilities Library
============================

[](#common-php-utilities-library)

A collection of utility methods for Strings, Arrays and Numbers. A must-have in most projects.

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

[](#installation)

```
composer require creativestyle/utilities

```

ArrayHelpers
------------

[](#arrayhelpers)

### `pickColumn(array $table, $column)`

[](#pickcolumnarray-table-column)

Assuming that you've got an array of associate arrays (`$table`) this method will return a single-dimensional array with values of the selected key (`$column`).

### `pick(array $keys, array $subject)`

[](#pickarray-keys-array-subject)

Picks selected `$keys` from the `$subject` associative array.

### `map(array $arr, $callback)`

[](#maparray-arr-callback)

Maps the array allowing you to change the keys.

Callback is called with (`$key`, `$value`) parameters and shall return a `[$newkey => $newvalue]` array.

It's possible to map a single entry to multiple by returning more than one item from the `$callback`.

### `average(array $arr, $key = null)`

[](#averagearray-arr-key--null)

Averages array values. If key is set then the column indicated by key is averaged.

RandHelpers
-----------

[](#randhelpers)

### `seed()`

[](#seed)

Returns long string of digits.

### `randBool($trueChance)`

[](#randbooltruechance)

Returns random bool with `$trueChance` \[0, 1\] of returning `true`.

### `arrayRand(array $array)`

[](#arrayrandarray-array)

Returns random array element.

### `sample(array $array, $count = 1)`

[](#samplearray-array-count--1)

Returns `$count` unique random elements from the `$array`.

If the desired number of results is equal or greater to the array size then the array is shuffled. If it's less or equal to 0, then empty array is returned.

### `gaussianRand($mu, $sigma)`

[](#gaussianrandmu-sigma)

Returns a random number from gaussian distribution with desired params.

### `normalProbabilityDensity($x, $mu, $sigma)`

[](#normalprobabilitydensityx-mu-sigma)

Returns a random number from normal distribution with desired params.

StringHelpers
-------------

[](#stringhelpers)

### `urlize($text)`

[](#urlizetext)

Transliterates the text keeping only alphanumeric characters and `-`. Whitespace is collapsed and transformed to `-`.

### `slugify($text)`

[](#slugifytext)

Alias to `urlize()`.

### `joinNotEmpty(array $elements, $delimiter = ', ')`

[](#joinnotemptyarray-elements-delimiter---)

Behaves the same way as `implode` but skips empty array elements.

### `endsWith($haystack, $needle)`

[](#endswithhaystack-needle)

Checks if `$haystack` ends with `$needle`.

### `startsWith($haystack, $needle)`

[](#startswithhaystack-needle)

Checks if `$haystack` starts with `$needle`.

### `convertToTitleCase($string)`

[](#converttotitlecasestring)

Converts the string To The Title Case.

### `capitalize($string)`

[](#capitalizestring)

Capitalizes the string (same as `ucfirst`) in a multibyte-safe manner.

### `humanize($text)`

[](#humanizetext)

Humanizes a camelCase variable name. For example `virtualRealityInterposer` will become `Virtual reality interposer`.

### `humanizeConst($constName)`

[](#humanizeconstconstname)

Works similar to `humanize` but converts const names like `VIRTUAL_REALITY_INTERPOSER`.

### `isCoercibleToString($value)`

[](#iscoercibletostringvalue)

Returns true if the value can be converted to string (is a scalar or has `__toString` method).

###  Health Score

33

—

LowBetter than 76% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity24

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 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

Every ~128 days

Total

5

Last Release

2558d ago

Major Versions

v1.0.0 → v2.02019-01-16

v2.1 → v3.0.02019-03-20

PHP version history (2 changes)v1.0.0PHP &gt;=5.5

v3.0.0PHP &gt;=7.1

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/6814811?v=4)[creativestyle](/maintainers/creativestyle)[@creativestyle](https://github.com/creativestyle)

---

Top Contributors

[![pinkeen](https://avatars.githubusercontent.com/u/2019132?v=4)](https://github.com/pinkeen "pinkeen (8 commits)")

---

Tags

arraystringutilities

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/creativestyle-utilities/health.svg)

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

###  Alternatives

[nette/utils

🛠 Nette Utils: lightweight utilities for string &amp; array manipulation, image handling, safe JSON encoding/decoding, validation, slug or strong password generating etc.

2.1k383.2M1.4k](/packages/nette-utils)[phootwork/lang

Missing PHP language constructs

1223.8M8](/packages/phootwork-lang)[clausnz/php-helpers

A Collection of useful php helper functions.

388.3k](/packages/clausnz-php-helpers)[michaldudek/foundation

A set of useful PHP classes.

13111.6k12](/packages/michaldudek-foundation)[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.

2515.8k](/packages/iteks-laravel-enum)

PHPackages © 2026

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