PHPackages                             syntatis/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. [Validation &amp; Sanitization](/categories/validation)
4. /
5. syntatis/utils

ActiveLibrary[Validation &amp; Sanitization](/categories/validation)

syntatis/utils
==============

Handy functions for PHP

v2.1.0(1y ago)744.9k↓31.3%[3 PRs](https://github.com/syntatis/utils-php/pulls)1MITPHPPHP &gt;=7.4CI passing

Since Dec 29Pushed 3mo agoCompare

[ Source](https://github.com/syntatis/utils-php)[ Packagist](https://packagist.org/packages/syntatis/utils)[ Docs](https://github.com/syntatis/utils-php#README)[ RSS](/packages/syntatis-utils/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (13)Versions (19)Used By (1)

🧰 utils-php
===========

[](#-utils-php)

[![ci](https://github.com/syntatis/utils-php/actions/workflows/ci.yml/badge.svg)](https://github.com/syntatis/utils-php/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/92993fde4f19b1c418018a3ebfa859e5fa99b72cfb65362c2f11d981d26d6372/68747470733a2f2f636f6465636f762e696f2f67682f73796e74617469732f7574696c732d7068702f67726170682f62616467652e7376673f746f6b656e3d5148333837425931504b)](https://codecov.io/gh/syntatis/utils-php)[![Packagist Downloads](https://camo.githubusercontent.com/83f54c3993df63008230df22a80dd6b510fe5ade6d74aa0d93e335a5b298d8ca/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f73796e74617469732f7574696c73)](https://packagist.org/packages/syntatis/utils)[![Packagist Dependency Version](https://camo.githubusercontent.com/00b90bde0f3f0fec3831fc552767422c32972ea85edf483bb79402a84c3b9c18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f73796e74617469732f7574696c732f7068703f636f6c6f723d253233374138364238)](https://camo.githubusercontent.com/00b90bde0f3f0fec3831fc552767422c32972ea85edf483bb79402a84c3b9c18/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f646570656e64656e63792d762f73796e74617469732f7574696c732f7068703f636f6c6f723d253233374138364238)

The `syntatis/utils` package provides a variety of utility functions to simplify common tasks in PHP, including validation, case conversion, and inflection.

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

[](#installation)

You can install the package via Composer:

```
composer require syntatis/utils
```

Usage
-----

[](#usage)

### Validator

[](#validator)

This package includes several functions for validating values, such as checking if a value is an email, URL, or whether it is blank.

FunctionDescription`Val::isBlank`Checks if a value is blank or empty.`Val::isEmail`Checks if a value is a valid email address.`Val::isURL`Checks if a value is a valid URL.`Val::isUUID`Checks if a value is a valid UUID.`Val::isSemVer`Checks if a value is in valid SemVer format.`Val::isIPAddress`Checks if a value is a valid IPv4 or IPv6 address.`Val::isUnique`Checks if all elements in a collection are unique.#### Examples

[](#examples)

```
use function Syntatis\Utils\Val;

// Check if a value is blank or empty
Val::isBlank(''); // true
Val::isBlank(' '); // true
Val::isBlank('foo '); // false

// Check if a value is a valid email address
Val::isEmail('example@example.com'); // true
Val::isEmail('invalid-email'); // false
```

### Strings

[](#strings)

This package includes several functions to handle strings, such as converting a string to camel case, makes a word plural, or checking if a string starts with a specific substring.

FunctionDescription`Str::toCamelCase`Converts a string to camel case e.g. `foo_bar` to `fooBar`.`Str::toSnakeCase`Converts a string to snake case e.g. `fooBar` to `foo_bar`.`Str::toKebabCase`Converts a string to kebab case e.g. `fooBar` to `foo-bar`.`Str::toPascalCase`Converts a string to Pascal case e.g. `foo_bar` to `FooBar`.`Str::toTitleCase`Converts a string to title case e.g. `foo_bar` to `Foo Bar`.`Str::toSentenceCase`Converts a string to sentence case e.g. `foo_bar` to `Foo bar`.`Str::toLowerCase`Converts a string to lower case e.g. `FooBar` to `foobar`.`Str::toUpperCase`Converts a string to upper case e.g. `fooBar` to `FOOBAR`.`Str::toMacroCase`Converts a string to macro case e.g. `fooBar` to `FOO_BAR`.`Str::toCobolCase`Converts a string to Cobol case e.g. `fooBar` to `FOO-BAR`.`Str::startsWith`Check if a string starts with a specific substring.`Str::endsWith`Check if a string ends with a specific substring.#### Examples

[](#examples-1)

```
use function Syntatis\Utils\Str;

// Convert a string to camel case
Str::toCamelCase('foo_bar'); // fooBar

// Check if a string starts with a specific substring
Str::startsWith('Hello, World!', 'Hello'); // true
```

### Arrays

[](#arrays)

This package includes several functions to handle arrays. For example, checking if an array is a list or associative array, or checking if all elements in an array are unique.

FunctionDescription`Arr::isList`Checks if an array is a list. If not then it is an associative array.`Arr::isUnique`Checks if all elements in an array are unique.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance61

Regular maintenance activity

Popularity34

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity51

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 55.8% 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 ~22 days

Total

14

Last Release

581d ago

Major Versions

v1.5.1 → v2.0.02024-09-30

PHP version history (2 changes)v1.0.0PHP ^7.4 || ^8.0

v1.0.1PHP &gt;=7.4

### Community

Maintainers

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

---

Top Contributors

[![tfirdaus](https://avatars.githubusercontent.com/u/2067467?v=4)](https://github.com/tfirdaus "tfirdaus (48 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (38 commits)")

---

Tags

arrayscase-convertercomposer-packagestringsvalidationvalidatorutilitiescase-converter

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[respect/validation

The most awesome validation engine ever created for PHP

5.9k37.4M383](/packages/respect-validation)[seld/jsonlint

JSON Linter

1.3k217.8M205](/packages/seld-jsonlint)[composer/spdx-licenses

SPDX licenses list and validation library.

1.4k184.2M25](/packages/composer-spdx-licenses)[opis/json-schema

Json Schema Validator for PHP

64736.9M186](/packages/opis-json-schema)[intervention/validation

Additional validation rules for the Laravel framework

6826.7M8](/packages/intervention-validation)[laminas/laminas-validator

Validation classes for a wide range of domains, and the ability to chain validators to create complex validation criteria

15644.9M188](/packages/laminas-laminas-validator)

PHPackages © 2026

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