Download the PHP package effectra/to-string without Composer
On this page you can find all versions of the php package effectra/to-string. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package to-string
to-string PHP Library
to-string
is a PHP library that provides various utility classes for string manipulation and conversion. It offers functionality to convert text case, strip tags, generate slugs, format arrays, and handle date/time values.
Installation
You can install the to-string
library via Composer. Run the following command in your project directory:
Usage
TextToString
toUppercase(string $text): string
Converts a string to uppercase.
toLowercase(string $text): string
Converts a string to lowercase.
strip(string $text): string
Strips HTML and PHP tags from a string.
nameVar($variable): string
Extracts the variable name from the caller's context.
textToSlug($text): string
Converts a string to a URL-friendly slug.
slugToText($slug): string
Converts a URL-friendly slug back to readable text.
generateRandomText($length): string
Generates a random text of specified length.
ArrayToString
array(array $array): string
Converts an array to a string representation.
arrayToText(array $data, string $separator = ','): string
Converts an array to a string by joining its elements with a separator.
arrayToSlug(array $data): string
Converts an array to a URL-friendly slug by joining its elements with a separator.
arrayToTextKeyValue($data): string
Converts an array or JSON string to a key-value pair string representation.
DateToString
formatTime(int $time): string
Formats a time value in seconds into HH:MM:SS format.
formatDate(int $timestamp): string
Formats a timestamp into YYYY-MM-DD format.
License
This library is licensed under the MIT License. See the LICENSE file for more information.
Contributing
Contributions are welcome! If you have any improvements or bug fixes, please submit a pull request.
Credits
The to-string
library is developed and maintained by Effectra.
Support
For any questions or issues, please open an issue on GitHub.
Feel free to modify the README file according to your specific library details, such as author information, additional sections, or formatting preferences.