PHPackages                             darling/php-text-types - 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. darling/php-text-types

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

darling/php-text-types
======================

A collection of classes that represent various types of text.

v1.1.8(2y ago)11.7k[1 issues](https://github.com/sevidmusic/PHPTextTypes/issues)8MITPHPPHP ^8.1CI passing

Since Feb 11Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/sevidmusic/PHPTextTypes)[ Packagist](https://packagist.org/packages/darling/php-text-types)[ RSS](/packages/darling-php-text-types/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (4)Versions (21)Used By (8)

PHPTextTypes
============

[](#phptexttypes)

A collection of classes that represent various types of text.

- [Installation](#installation)
- [Classes](#classes)

    - [Darling\\PHPTextTypes\\classes\\strings\\Text](#darlingphptexttypesclassesstringstext)
    - [Darling\\PHPTextTypes\\classes\\strings\\ClassString](#darlingphptexttypesclassesstringsclassstring)
    - [Darling\\PHPTextTypes\\classes\\strings\\UnknownClass](#darlingphptexttypesclassesstringsunknownclass)
    - [Darling\\PHPTextTypes\\classes\\strings\\SafeText](#darlingphptexttypesclassesstringssafetext)
    - [Darling\\PHPTextTypes\\classes\\strings\\AlphanumericText](#darlingphptexttypesclassesstringsalphanumerictext)
    - [Darling\\PHPTextTypes\\classes\\strings\\Name](#darlingphptexttypesclassesstringsname)
    - [Darling\\PHPTextTypes\\classes\\strings\\Id](#darlingphptexttypesclassesstringsid)

Installation
============

[](#installation)

```
composer require darling/php-text-types

```

Classes
=======

[](#classes)

The following is an overview of the classes provided by the `PHPTextTypes` library.

These classes can be used as is, or extended to define new types of text.

### [Darling\\PHPTextTypes\\classes\\strings\\Text](https://github.com/sevidmusic/PHPTextTypes/blob/main/src/classes/strings/Text.php)

[](#darlingphptexttypesclassesstringstext)

Text represents a string, can be cast to the string it represents, and can provide information about the string it represents.

Note: The [Darling\\PHPTextTypes\\classes\\strings\\Text](https://github.com/sevidmusic/PHPTextTypes/blob/main/src/classes/strings/Text.php)class is the parent of all other classes defined by this library.

Example:

```
