PHPackages                             vpg/titon.utility - 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. vpg/titon.utility

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

vpg/titon.utility
=================

The Titon utility package provides convenience classes for basic tasks like validation, formatting, sanitization and more.

v1.2(8y ago)014.3k↓30.4%1BSD-2-ClausePHPPHP &gt;=5.3.0

Since Jan 1Pushed 2mo ago8 watchersCompare

[ Source](https://github.com/vpg/titon.utility)[ Packagist](https://packagist.org/packages/vpg/titon.utility)[ Docs](http://titon.io)[ RSS](/packages/vpg-titonutility/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (3)DependenciesVersions (5)Used By (1)

Utility v0.13.4 [![Build Status](https://camo.githubusercontent.com/9cd1b75575bde55b358b72692b6f8f4fce219707f8c23e546d348815fb6d1279/68747470733a2f2f7472617669732d63692e6f72672f7469746f6e2f7574696c6974792e706e67)](https://travis-ci.org/titon/utility)
==========================================================================================================================================================================================================================================================

[](#utility-v0134-)

The Titon utility package provides lightweight static classes for common tasks. All utilities extend a powerful macro system which permits the addition of new static methods at runtime.

```
use Titon\Utility\Inflector;

Inflector::macro('upperCase', function($value) {
    return strtoupper($value);
});

Inflector::upperCase('foo'); // FOO
```

Amongst the robust macro system, we can easily execute other functionality, for example. The `Converter` converts one type of data to another.

```
Titon\Utility\Converter::toArray($xml); // Supports arrays, objects, JSON, XML, serialized
```

`Crypt` encrypts and decrypts data through the mcrypt extension.

```
Titon\Utility\Crypt::blowfish('foobar', $salt);
```

`Format` formats strings into common patterns.

```
Titon\Utility\Format::phone('1234567890', '(###) ###-####'); // (123) 456-7890
```

`Hash` mutates or accesses data in arrays.

```
Titon\Utility\Hash::set($array, 'foo.bar', 'baz');
```

`Inflector` rewrites strings to specific forms.

```
Titon\Utility\Inflector::camelCase('foo bar'); // FooBar
```

`Number` applies calculations or evaluations on numbers.

```
Titon\Utility\Number::bytesTo(1024); // 1KB
```

`Path` resolves file paths, namespaces, and class names.

```
Titon\Utility\Path::className('Vendor\Foo\Bar'); // Bar
```

`Sanitize` cleans and filters data.

```
Titon\Utility\Sanitize::html($data);
```

`String` modifies and analyzes strings.

```
Titon\Utility\String::truncate($string);
```

`Time` evaluates and compares dates and times.

```
Titon\Utility\Time::isTomorrow($time);
```

`Validate` validates data with defined rules and patterns. Can be used in combination with the `Validator`, which provides an object oriented approach to data validation.

```
Titon\Utility\Validate::ext($path, ['gif', 'png', 'jpg']);
```

Most of the functionality found in the static classes can also be found in global functions. The list of all functions can be found in the bootstrap file within the source folder.

### Features

[](#features)

- `Converter` - Convert one type to another
- `Crypt` - Data encryption and decryption
- `Format` - Data formatting
- `Hash` - Object and array manipulation
- `Inflector` - String and grammar formatting
- `Number` - Number manipulation
- `Path` - File system and namespace path formatting
- `Sanitize` - Data cleaning and escaping
- `String` - String manipulation
- `Time` - Date and time manipulation
- `Validate` - Data validation and filtering
- `Validator` - Schema Rule Validation

### Requirements

[](#requirements)

- PHP 5.3.0
    - Multibyte
    - SimpleXML (for Converter)
    - Mcrypt (for Crypt)
    - Fileinfo (for Validate)

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance57

Moderate activity, may be stable

Popularity25

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 50% 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 ~577 days

Total

3

Last Release

3000d ago

### Community

Maintainers

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

---

Top Contributors

[![jrmbrgs](https://avatars.githubusercontent.com/u/1610846?v=4)](https://github.com/jrmbrgs "jrmbrgs (2 commits)")[![ogarbe](https://avatars.githubusercontent.com/u/1395245?v=4)](https://github.com/ogarbe "ogarbe (1 commits)")[![OlivierPiegay](https://avatars.githubusercontent.com/u/1914604?v=4)](https://github.com/OlivierPiegay "OlivierPiegay (1 commits)")

---

Tags

stringutilitypathconverterhashinflectorformattimeuuidvalidatecrypttitonnumbersanitize

### Embed Badge

![Health badge](/badges/vpg-titonutility/health.svg)

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

###  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.1k394.3M1.5k](/packages/nette-utils)[danielstjules/stringy

A string manipulation library with multibyte support

2.4k26.0M191](/packages/danielstjules-stringy)[cakephp/utility

CakePHP Utility classes such as Inflector, String, Hash, and Security

12027.1M63](/packages/cakephp-utility)[kwn/number-to-words

Multi language standalone PHP number to words converter. Fully tested, open for extensions and new languages.

4235.0M21](/packages/kwn-number-to-words)[matthiasmullie/path-converter

Relative path converter

10229.6M7](/packages/matthiasmullie-path-converter)[voku/stringy

A string manipulation library with multibyte support

1783.8M19](/packages/voku-stringy)

PHPackages © 2026

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