定制 twipsi/normalizer 二次开发

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

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

twipsi/normalizer

最新稳定版本:1.0.0

Composer 安装命令:

composer require twipsi/normalizer

包简介

Provides a basic class to normalize and slugify strings

README 文档

README

A very simple class to normalize and slugify a string or url.

Install

composer require twipsi/normalizer

Usage

To just clean out html tags and line/tab spaces.

$string = "Hel  lo <br><div>Wor
ld</div>";

Normalizer::normalizeString($string);

Output: "Hello World"

You can also set the transliterate attribute to transliterate.

$string = "Hél  lö <br><div>Wőr
ld</div>";

Normalizer::normalizeString($string, true);

Output: "Hello World"

To slugify a string using default "\/_|+ -" characters as separation identifiers.

$string = "H\\él/ló|W_ö+r l-d";

Normalizer::slugifyString($string);

Output: "h-el-lo-w-o-r-l-d"

You can also specify your own separator.

$string = "H\\él/ló|W_ö+r l-d";

Normalizer::slugifyString($string, '_');

Output: "h_el_lo_w_o_r_l_d"

To slugify a url/path using default "_|+ -" characters as separation identifiers.

$string = "https:://test.com/Tést page/Sep|ar_ate+Thís/?örg=éáő";
Normalizer::slugifyPath($string);

Output: "https:://test.com/test-page/sep-ar-ate-this/?org=eao"

You can also specify your own separator.

$string = "https:://test.com/Tést page/Sep|ar_ate+Thís/?örg=éáő";

Normalizer::slugifyPath($string, '_');

Output: "https:://test.com/test_page/sep_ar_ate_this/?org=eao"

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: BSD-3-Clause
  • 更新时间: 2022-09-29

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固