__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
/**
* @package utf8
*/
//---------------------------------------------------------------
/**
* Replacement for str_pad. $padStr may contain multi-byte characters.
*
* @author Oliver Saunders <oliver (a) osinternetservices.com>
* @param string $input
* @param int $length
* @param string $padStr
* @param int $type ( same constants as str_pad )
* @return string
* @see http://www.php.net/str_pad
* @see utf8_substr
* @package utf8
*/
function utf8_str_pad($input, $length, $padStr = ' ', $type = STR_PAD_RIGHT)
{
$inputLen = utf8_strlen($input);
if ($length <= $inputLen) {
return $input;
}
$padStrLen = utf8_strlen($padStr);
$padLen = $length - $inputLen;
if ($type == STR_PAD_RIGHT) {
$repeatTimes = ceil($padLen / $padStrLen);
return utf8_substr($input . str_repeat($padStr, $repeatTimes), 0, $length);
}
if ($type == STR_PAD_LEFT) {
$repeatTimes = ceil($padLen / $padStrLen);
return utf8_substr(str_repeat($padStr, $repeatTimes), 0, floor($padLen)) . $input;
}
if ($type == STR_PAD_BOTH) {
$padLen /= 2;
$padAmountLeft = floor($padLen);
$padAmountRight = ceil($padLen);
$repeatTimesLeft = ceil($padAmountLeft / $padStrLen);
$repeatTimesRight = ceil($padAmountRight / $padStrLen);
$paddingLeft = utf8_substr(str_repeat($padStr, $repeatTimesLeft), 0, $padAmountLeft);
$paddingRight = utf8_substr(str_repeat($padStr, $repeatTimesRight), 0, $padAmountLeft);
return $paddingLeft . $input . $paddingRight;
}
trigger_error('utf8_str_pad: Unknown padding type (' . $type . ')', E_USER_ERROR);
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| mbstring | Folder | 0775 |
|
|
| native | Folder | 0775 |
|
|
| utils | Folder | 0775 |
|
|
| LICENSE | File | 25.81 KB | 0664 |
|
| README | File | 3.21 KB | 0664 |
|
| ord.php | File | 2.62 KB | 0664 |
|
| str_ireplace.php | File | 1.88 KB | 0664 |
|
| str_pad.php | File | 1.63 KB | 0664 |
|
| str_split.php | File | 763 B | 0664 |
|
| strcasecmp.php | File | 486 B | 0664 |
|
| strcspn.php | File | 833 B | 0664 |
|
| stristr.php | File | 810 B | 0664 |
|
| strrev.php | File | 400 B | 0664 |
|
| strspn.php | File | 870 B | 0664 |
|
| substr_replace.php | File | 559 B | 0664 |
|
| trim.php | File | 2.14 KB | 0664 |
|
| ucfirst.php | File | 740 B | 0664 |
|
| ucwords.php | File | 1.37 KB | 0664 |
|
| utf8.php | File | 2.67 KB | 0664 |
|