gugglegum/mb-str-pad 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

gugglegum/mb-str-pad

最新稳定版本:1.0.1

Composer 安装命令:

composer require gugglegum/mb-str-pad

包简介

mb_str_pad() - multibyte implementation of str_pad() function

README 文档

README

This is true multibyte implementation of PHP's built-in string function str_pad() which support UTF-8 both in $input and in $pad_string.

This function is implemented as a static method of MbString class (not as a standalone function) because PHP doesn't doesn't support autoloading of functions on demand. You will not want to include it prior every usage.

Installation

Quite simple: composer require gugglegum/mb-str-pad

Usage

<?php

require_once 'vendor/autoload.php';

use gugglegum\mb_str_pad\MbString;

$input = 'Привет'; 
$pad_length = 20; 
$pad_string = '÷˟‾҈';
$pad_type = STR_PAD_BOTH;
$encoding = 'UTF-8';

echo MbString::mb_str_pad($input, $pad_length, $pad_string, $pad_type, $encoding);

In all cases of using single-byte $input and $pad_string the result will be the same as of built-in str_pad() function.

统计信息

  • 总下载量: 3.67k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-22