PHP code example of shetabit / helper
1. Go to this page and download the library: Download shetabit/helper 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/ */
shetabit / helper example snippets
Shetabit\Helper\HelperServiceProvider::class,
'Helper' => Shetabit\Helper\Facades::class,
...randomPassword(int $length = 9, string $availableSets = 'luds');
Helper::randomPassword(); //Output: '9nZnE%3wB'
//Or
random_password(); //Output: '9nZnE%3wB'
...persianSlug(string $string, string $separator = '-')
Helper::persianSlug('ایران سرای من'); //Output: 'ایران-سرای-من'
//Or
persian_slug('ایران سرای من'); //Output: 'ایران-سرای-من'
...faToEnNums(string $number)
Helper::faToEnNums('۵۶89٤٦'); //Output: '568946'
//Or
fa_to_en_nums('۵۶89٤٦'); //Output: '568946'
...removeComma(string $value)
Helper::removeComma('5000,000'); //Output: '5000000'
//Or
remove_comma('5000,000') //Output: '5000000'
...toGregorian(string $jDate)
Helper::toGregorian('1397/12/11'); //Output: '2018/3/2'
//Or
to_gregorian('1397/12/11') //Output: '2018/3/2'
...mbJsonEncode(array $input)
Helper::mbJsonEncode(['name' => 'علی', 'family' => 'حمزه ای']); //Output: '{"name":"علی","family":"حمزه ای"}'
//Or
mb_json_encode(['name' => 'علی', 'family' => 'حمزه ای']) //Output: '{"name":"علی","family":"حمزه ای"}'