|
1 | | -<?php |
2 | | - |
3 | | -use Tamedevelopers\Support\Str; |
4 | | -use Tamedevelopers\Support\Tame; |
5 | | - |
6 | | -require_once __DIR__ . '/../vendor/autoload.php'; |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | -$arrayCollection = [ |
12 | | - 0 => [ |
13 | | - 'id' => 1, |
14 | | - 'name' => 'Fred Peter', |
15 | | - 'age' => 18, |
16 | | - 'is_active' => 1 |
17 | | - ], |
18 | | - 1 => [ |
19 | | - 'id' => 2, |
20 | | - 'name' => 'Cli Patton', |
21 | | - 'age' => 25, |
22 | | - 'is_active' => 0 |
23 | | - ] |
24 | | -]; |
25 | | - |
26 | | -$changeArrayKeys = Str::changeKeysFromArray( |
27 | | - $arrayCollection, |
28 | | - 'is_active', |
29 | | - 'active' |
30 | | -); |
31 | | - |
32 | | -$removeArrayKeys = Str::removeKeysFromArray( |
33 | | - $arrayCollection, |
34 | | - ['is_active', 'id'] |
35 | | -); |
36 | | - |
37 | | - |
38 | | -dd( |
39 | | - $changeArrayKeys, |
40 | | - $removeArrayKeys, |
41 | | - |
42 | | - Str::snake('Peterso More'), |
43 | | - Str::camel('peterson more'), |
44 | | - Str::studly('peterson more'), |
45 | | - Str::kebab('Peterson More'), |
46 | | - Str::slug('Peterson More'), |
47 | | - Str::slugify('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 'cn'), |
48 | | - Str::random(), |
49 | | - Str::uuid(), |
50 | | - Str::randomWords(10), |
51 | | - Str:: mask( '[email protected]', 4), |
52 | | - Str::shorten('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 20), |
53 | | - Str::html('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'), |
54 | | - Str::text('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'), |
55 | | - Str::hash('hoping for more'), |
56 | | - Str::phone('+234 (90) 012-234'), |
57 | | - Str::phone('+234 (90) 012-234', false), |
58 | | -); |
59 | | - |
| 1 | +<?php |
| 2 | + |
| 3 | +use Tamedevelopers\Support\Str; |
| 4 | +use Tamedevelopers\Support\Tame; |
| 5 | + |
| 6 | +require_once __DIR__ . '/../vendor/autoload.php'; |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | +$arrayCollection = [ |
| 12 | + 0 => [ |
| 13 | + 'id' => 1, |
| 14 | + 'name' => 'Fred Peter', |
| 15 | + 'age' => 18, |
| 16 | + 'is_active' => 1 |
| 17 | + ], |
| 18 | + 1 => [ |
| 19 | + 'id' => 2, |
| 20 | + 'name' => 'Cli Patton', |
| 21 | + 'age' => 25, |
| 22 | + 'is_active' => 0 |
| 23 | + ] |
| 24 | +]; |
| 25 | + |
| 26 | +$changeArrayKeys = Str::changeKeysFromArray( |
| 27 | + $arrayCollection, |
| 28 | + 'is_active', |
| 29 | + 'active' |
| 30 | +); |
| 31 | + |
| 32 | +$removeArrayKeys = Str::removeKeysFromArray( |
| 33 | + $arrayCollection, |
| 34 | + ['is_active', 'id'] |
| 35 | +); |
| 36 | + |
| 37 | + |
| 38 | +dd( |
| 39 | + $changeArrayKeys, |
| 40 | + $removeArrayKeys, |
| 41 | + |
| 42 | + Str::snake('Peterso More'), |
| 43 | + Str::camel('peterson more'), |
| 44 | + Str::studly('peterson more'), |
| 45 | + Str::kebab('Peterson More'), |
| 46 | + Str::slug('Peterson More'), |
| 47 | + Str::slugify('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 'cn'), |
| 48 | + Str::random(), |
| 49 | + Str::uuid(), |
| 50 | + Str::randomWords(10), |
| 51 | + Str:: mask( '[email protected]', 4), |
| 52 | + Str::shorten('【2023最新】香港郵政本地平郵郵費計算、基本郵費一覽', 20), |
| 53 | + Str::html('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'), |
| 54 | + Str::text('<span class="pul-text pul-text--bold smb-web-view-dynamic-list-item-title">lhkexpressvps.com <script></script></span>'), |
| 55 | + Str::hash('hoping for more'), |
| 56 | + Str::phone('+234 (90) 012-234'), |
| 57 | + Str::phone('+234 (90) 012-234', false), |
| 58 | +); |
| 59 | +
|
0 commit comments