You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
1.2 KiB
PHP
32 lines
1.2 KiB
PHP
<?php
|
|
|
|
use jrosset\MbstringExtended;
|
|
|
|
if (!function_exists('mb_ucfirst')) {
|
|
/**
|
|
* Multi-bytes implementation for {@see https://www.php.net/manual/function.ucfirst.php ucfirst}
|
|
*
|
|
* @param string $string The input string
|
|
*
|
|
* @return string The resulting string
|
|
*/
|
|
function mb_ucfirst (string $string): string {
|
|
return MbstringExtended::ucfirst($string);
|
|
}
|
|
}
|
|
if (!function_exists('mb_str_pad')) {
|
|
/**
|
|
* Multi-bytes implementation for {@see https://www.php.net/manual/function.str-pad.php str_pad}
|
|
*
|
|
* @param string $string The input string
|
|
* @param int $length The minimum string length
|
|
* @param string $pad_string The padding string
|
|
* @param int $pad_type STR_PAD_RIGHT, STR_PAD_LEFT, or STR_PAD_BOTH
|
|
* @param string|null $encoding The character encoding or the internal character encoding value is Null
|
|
*
|
|
* @return string The padded string
|
|
*/
|
|
function mb_str_pad (string $string, int $length, string $pad_string = ' ', int $pad_type = STR_PAD_RIGHT, string $encoding = null): string {
|
|
return MbstringExtended::str_pad($string, $length, $pad_string, $pad_type, $encoding);
|
|
}
|
|
} |