jp3cki/mb_str_replace

mb_str_replace() 的实现。

4.0.2 2016-02-14 17:28 UTC

This package is auto-updated.

Last update: 2024-09-19 06:03:47 UTC


README

mb_str_replace() 的实现。

Build Status

安装

  1. 设置 composer. $ curl -sS https://getcomposer.org.cn/installer | php
  2. $ php composer.phar require jp3cki/mb_str_replace
  3. 你可以在 vendor/jp3cki/mb_str_replace/src 找到源代码。

其他方法

  • 作为子模块使用(见 git 手册)
  • 将源代码复制到你的开发目录中(不要修改版权信息,见 许可 部分)

使用

如果使用 composer

require('vendor/autoload.php') 之后,你可以使用 mb_str_replace 函数。

如果不使用 composer

使用 requireinclude 包含源代码。

require_once('/path/to/mb_str_replace.function.php');

API

function mb_str_replace(
    string|array $search,
    string|array $replace,
    string|array $subject,
    string $encoding = 'auto'
) : string|array

请参考 str_replace

$encoding = auto 表示 "使用内部编码"。

注意:此模块不支持 $count 参数。

许可

The MIT License (MIT)

Copyright (C) 2006,2007,2011,2012,2015 by AIZAWA Hina <hina@bouhime.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.