lukehayes / str-utils
String utility helper functions for PHP.
Installs: 0
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/lukehayes/str-utils
Requires (Dev)
- phpunit/phpunit: ^9.5
- symfony/var-dumper: ^5.2
This package is auto-updated.
Last update: 2025-11-21 05:45:52 UTC
README
A library of string helpers, to aid a developer.
This is really a small helper project to help with my own needs when I need to alter a string in some way. Rather than trying to remember built in PHP functions, why not make them available in a simple to use API?
Examples
First, require the library using:
require "vendor/autoload.php"; use LH\StrUtils;
then call the static methods:
PascalCase
StrUtils::PascalCase("string utils") # returns StringUtils
CamelCase
StrUtils::CamelCase("string utils") # returns stringUtils
SnakeCase
StrUtils::SnakeCase("string utils") # returns string_utils
Size
StrUtils::Size("string utils") # returns 12
ConvertToInt
StrUtils::ConvertToInt("A") # returns 65
Uglify
StrUtils::Uglify(<A string containing code>)