|
2 | 2 | <a href="https://github.com/php-forge/helpers" target="_blank"> |
3 | 3 | <img src="https://avatars.githubusercontent.com/u/103309199?s%25253D400%252526u%25253Dca3561c692f53ed7eb290d3bb226a2828741606f%252526v%25253D4" height="100px"> |
4 | 4 | </a> |
5 | | - <h1 align="center">Collection of Helpers for PHP.</h1> |
| 5 | + <h1 align="center">Collection of Helper for PHP.</h1> |
6 | 6 | <br> |
7 | 7 | </p> |
8 | 8 |
|
@@ -45,7 +45,71 @@ or add |
45 | 45 |
|
46 | 46 | ## Usage |
47 | 47 |
|
48 | | -[Check the documentation docs](/docs/README.md) to learn about usage. |
| 48 | +The repository contains a collection of utility functions designed to simplify common programming tasks in PHP. |
| 49 | + |
| 50 | +Whether you're working on web development, data processing, or other projects, these helper functions can save you time |
| 51 | +and effort. |
| 52 | + |
| 53 | +## Converts a camelCase formatted string to snake_case |
| 54 | + |
| 55 | +```php |
| 56 | +<?php |
| 57 | + |
| 58 | +declare(strict_types=1); |
| 59 | + |
| 60 | +use PHPForge\Helper\WordFormatter; |
| 61 | + |
| 62 | +$word = WordFormatter::camelCaseToSnakeCase('date_birth'); |
| 63 | +``` |
| 64 | + |
| 65 | +## Convert a snake_case formatted string to camelCase |
| 66 | + |
| 67 | +```php |
| 68 | +<?php |
| 69 | + |
| 70 | +declare(strict_types=1); |
| 71 | + |
| 72 | +use PHPForge\Helper\WordFormatter; |
| 73 | + |
| 74 | +$word = WordFormatter::snakeCaseToCamelCase('date_birth'); |
| 75 | +``` |
| 76 | + |
| 77 | +## Converts a string to words with capitalized first letters |
| 78 | + |
| 79 | +```php |
| 80 | +<?php |
| 81 | + |
| 82 | +declare(strict_types=1); |
| 83 | + |
| 84 | +use PHPForge\Helper\WordFormatter; |
| 85 | + |
| 86 | +$word = WordFormatter::capitalizeToWords('Date Birth'); |
| 87 | +``` |
| 88 | + |
| 89 | +## Generate ramdon pasword |
| 90 | + |
| 91 | +```php |
| 92 | +<?php |
| 93 | + |
| 94 | +declare(strict_types=1); |
| 95 | + |
| 96 | +use PHPForge\Helper\Password; |
| 97 | + |
| 98 | +$password = Password::generate(8); |
| 99 | +``` |
| 100 | + |
| 101 | + |
| 102 | +## Get all timezones |
| 103 | + |
| 104 | +```php |
| 105 | +<?php |
| 106 | + |
| 107 | +declare(strict_types=1); |
| 108 | + |
| 109 | +use PHPForge\Helper\Timezone; |
| 110 | + |
| 111 | +$timezones = Timezone::getAll(); |
| 112 | +``` |
49 | 113 |
|
50 | 114 | ## Testing |
51 | 115 |
|
|
0 commit comments