PHPackages                             jwebas/utils - 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. jwebas/utils

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

jwebas/utils
============

A collection of useful PHP functions

0.0.2(6y ago)04MITPHPPHP &gt;=7.1.3

Since Jun 17Pushed 6y agoCompare

[ Source](https://github.com/jwebas/utils)[ Packagist](https://packagist.org/packages/jwebas/utils)[ RSS](/packages/jwebas-utils/feed)WikiDiscussions master Synced 3d ago

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

Jwebas Utils
============

[](#jwebas-utils)

A collection of useful PHP functions

Requirements
------------

[](#requirements)

Utils requires PHP 7.1.3+.

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

[](#installation)

The recommended way to install is via Composer:

```
composer require jwebas/utils

```

Usage
-----

[](#usage)

### Array helper

[](#array-helper)

```
use Jwebas\Utils\Arr;

// Determine whether the given value is array accessible.
Arr::accessible($value): bool

// Add an element to an array using "dot" notation if it doesn't exist.
Arr::add(array $array, string $key, $value): array

// Determine if the given key exists in the provided array.
Arr::exists($array, $key): bool

// Returns the first element in an array.
Arr::first(array $array)

// Returns the first key in an array.
Arr::firstKey(array $array)

// Remove one or many array items from a given array using "dot" notation.
Arr::forget(array &$array, $keys): void

// Get an item from an array using "dot" notation.
Arr::get(array $array, string $key, $default = null)

// Check if an item or items exist in an array using "dot" notation.
Arr::has($array, $keys): bool

// Returns the last element in an array.
Arr::last(array $array)

// Returns the last key in an array.
Arr::lastKey(array $array)

// Push an item onto the beginning of an array.
Arr::prepend(array $array, $value, $key = null): array

// Get a value from the array, and remove it.
Arr::pull(array &$array, string $key, $default = null)

// Set an array item to a given value using "dot" notation.
//If no key is given to the method, the entire array will be replaced.
Arr::set(array &$array, string $key, $value): array

// Convert the array into a query string.
Arr::query(array $array): string

// Filter the array using the given callback.
Arr::where(array $array, callable $callback): array

// If the given value is not an array and not null, wrap it in one.
Arr::wrap($value): array
```

### File system

[](#file-system)

```
use Jwebas\Utils\FS;

// Get basename.
FS::basename(string $path): string

// Function to strip additional / or \ in a path name.
FS::clean(string $path, $dirSep = DIRECTORY_SEPARATOR): string

// Get dirname.
FS::dirName(string $path): string

// Checks whether a file or directory exists.
FS::exists(string $path): bool

// Get file extension.
FS::extension(string $path): string

// Get filename.
FS::filename(string $path): string

// Check is current path is directory.
FS::isDir(string $path): bool

// Check is current path is regular file
FS::isFile(string $path): bool

// Get realpath.
FS::realpath(string $path): string

// Removes a directory (and its contents) recursively.
FS::rmDir(string $dir, bool $traverseSymlinks = false): bool

// Strip off the extension if it exists.
FS::stripExtension(string $path): string
```

### String helper

[](#string-helper)

```
use Jwebas\Utils\Str;

// Transliterate a UTF-8 value to ASCII.
Str::ascii(string $value, string $language = 'en'): string

// Convert a value to camel case.
Str::camel(string $value): string

// Determine if a given string contains a given substring.
Str::contains(string $haystack, $needles): bool

// Determine if a given string ends with a given substring.
Str::endsWith(string $haystack, $needles): bool

// Convert a string to kebab case.
Str::kebab(string $value): string

// Return the length of the given string.
Str::length(string $value, $encoding = null): int

// Limit the number of characters in a string.
Str::limit(string $value, int $limit = 100, string $end = '...'): string

// Convert the given string to lower-case.
Str::lower(string $value): string

// Generate a more truly "random" alpha-numeric string.
Str::random(int $length = 16): string

// Generate a URL friendly "slug" from a given string.
Str::slug(string $title, string $separator = '-', $language = 'en'): string

// Convert a string to snake case.
Str::snake(string $value, string $delimiter = '_'): string

// Determine if a given string starts with a given substring.
Str::startsWith(string $haystack, $needles): bool

// Convert a value to studly caps case.
Str::studly(string $value): string

// Returns the portion of string specified by the start and length parameters.
Str::substr(string $string, int $start, $length = null): string

// Convert the given string to title case.
Str::title(string $value): string

// Make a string's first character uppercase.
Str::ucfirst(string $string): string

// Convert the given string to upper-case.
Str::upper(string $value): string

// Limit the number of words in a string.
Str::words(string $value, int $words = 100, string $end = '...'): string
```

### Url helper

[](#url-helper)

```
use Jwebas\Utils\Url;

// Check is ssl (https) is enabled.
Url::httpsEnabled(): bool

// Check if string is external url.
Url::isExternal(string $url, bool $strict = true): bool
```

### Links

[](#links)

- Illuminate Support (Laravel) -
- JBZoo Utils -

### TODO

[](#todo)

- Add tests

License
-------

[](#license)

The MIT License (MIT).

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity45

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

Every ~3 days

Total

2

Last Release

2521d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/58467cd91786e9cceea57bc94850165fb0657bd56d89f44e2233bde4f12e75b0?d=identicon)[jwebas](/maintainers/jwebas)

---

Top Contributors

[![jwebas](https://avatars.githubusercontent.com/u/30591152?v=4)](https://github.com/jwebas "jwebas (2 commits)")

---

Tags

phputilshelperscollectionutils

### Embed Badge

![Health badge](/badges/jwebas-utils/health.svg)

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

###  Alternatives

[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[voku/arrayy

Array manipulation library for PHP, called Arrayy!

4875.5M16](/packages/voku-arrayy)[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)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)[dereuromark/cakephp-tools

A CakePHP plugin containing lots of useful and reusable tools

338920.1k32](/packages/dereuromark-cakephp-tools)[pragmarx/ia-collection

Laravel Illuminate Agnostic Collection

473.4M2](/packages/pragmarx-ia-collection)

PHPackages © 2026

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