php-eight-four/string-utils

String utilities for PHP 8.4

Installs: 0

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

pkg:composer/php-eight-four/string-utils

v1.1.0 2025-05-12 14:18 UTC

This package is auto-updated.

Last update: 2025-12-12 18:13:04 UTC


README

A lightweight utility library to help with common string manipulations in PHP 8.4.

๐Ÿงฉ Features

This package provides easy-to-use static methods for transforming and analyzing strings, including:

  • Convert strings to:
    • camelCase
    • PascalCase
    • snake_case
    • kebab-case
  • Check if a string is a palindrome

๐Ÿ› ๏ธ Installation

You can install this package via Composer:

composer require php-eight-four/string-utils

๐Ÿงช Usage Examples

Import the class:

use PhpEightFour\StringUtils\StringUtils;

Convert to camelCase

echo StringUtils::toCamelCase("hello world"); // Outputs: helloWorld

Convert to PascalCase

echo StringUtils::toPascalCase("hello world"); // Outputs: HelloWorld

Convert to snake_case

echo StringUtils::toSnakeCase("HelloWorld"); // Outputs: hello_world

Convert to kebab-case

echo StringUtils::toKebabCase("HelloWorld"); // Outputs: hello-world

Check if a string is a palindrome

var_dump(StringUtils::isPalindrome("RaceCar")); // Outputs: true
var_dump(StringUtils::isPalindrome("Hello"));   // Outputs: false

๐Ÿ“ Namespace Structure

All classes are under the namespace:

\PhpEightFour\StringUtils\

๐Ÿ“š Requirements

  • PHP 8.4 or higher
  • Composer (for installation)

๐Ÿง‘โ€๐Ÿ’ป Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/new-feature)
  3. Commit your changes (git commit -am 'Add new feature')
  4. Push to the branch (git push origin feature/new-feature)
  5. Submit a pull request

๐Ÿ“„ License

MIT License โ€“ see the LICENSE file for details.

๐Ÿ“ฌ Contact

If you have any questions or suggestions, feel free to reach out at: