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
Requires (Dev)
- phpunit/phpunit: ^10
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:
camelCasePascalCasesnake_casekebab-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.
- Fork the repo
- Create your feature branch (
git checkout -b feature/new-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/new-feature) - 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: