定制 jlibs/php-string-max 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jlibs/php-string-max

最新稳定版本:v1.3.1

Composer 安装命令:

composer require jlibs/php-string-max

包简介

Util functions for string formating.

README 文档

README

Singleton class for string formating and templating.

Install

composer require jlibs/php-string-max

Usage:

require __DIR__ . '/../vendor/autoload.php';

use JLibs\StringMax;

Example 1:

echo StringMax::format(
    'Hi {{name}}, keep {{tip}}!',
    [
        'name' => 'developer',
        'tip' => 'building'
   ]
);
// prints: Hi developer, keep building!

Example 2:

$result = StringMax::replaceTokensInArray([
        'Hi {{name}}, remember to be {{tip}}.',
        'Because {{myTarget}} love nice {{myTarget}}',
        'and' => [
            'the world is better if we have more {{mates}}.'
        ]
    ],
    [
        'name'      => 'developer',
        'tip'       => 'nice',
        'myTarget'  => 'people',
        'mates'     => 'friends'
    ]
);
/*
Results:
$result = [
        'Hi developer, remember to be nice.',
        'Because people love nice friends',
        'and' => [
            'the world is better if we have more friends.'
        ]
]
*/

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-06-20