1. Go to this page and download the library: Download mellanyx/helpers library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
use Mellanyx\Helpers\Arr;
$arr = ['one', 'two', 'bar' => ['aaa' => 'str_aaa', 'bbb' => 'str_bbb']];
Arr::arraySet('bar.zzz', 'added from func', $arr)
Результат:
Array
(
[0] => one
[1] => two
[bar] => Array
(
[aaa] => str_aaa
[bbb] => str_bbb
[zzz] => added from func
)
)
use Mellanyx\Helpers\Str;
$keyValue = [
':color' => 'brown',
':animal' => 'dog'
];
$string = 'The quick :color fox jumps over the lazy :animal.';
Str::strInsert($keyValue, $string);
Результат: The quick brown fox jumps over the lazy dog.
use Mellanyx\Helpers\Str;
$string = 'The quick brown fox jumps over the lazy dog';
Str::limitWords($string, 3);
Результат: The quick brown...
use Mellanyx\Helpers\Str;
$string = 'The quick brown fox jumps over the lazy dog';
Str::limit($string, 15);
Результат: The quick brown...
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.