Download the PHP package wangqs/cut_elegant_string without Composer

On this page you can find all versions of the php package wangqs/cut_elegant_string. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cut_elegant_string

项目说明

优雅的将中文(中英混合)字符串裁剪为长度范围内的句子,主要用于大段文字分页、分局等场景。

主要解决2痛点:

  1. 中英文混合字符串常规的裁剪无非是按字数(长度)裁剪,或者按段落、标点等特征值裁剪.无法【优雅】的裁剪出合适字数(长度)的整句句子。
  2. 中英文混合的字符串,由于编码方式原因,常规裁剪方法,无法【优雅】的中文按单个汉字,英文按单词进行统计长度和裁剪.

优雅的处理结果:

  1. 按规定的长度,进行整句字符串裁剪,默认会根据中文标点进行整句判断,尽量不断句、不裁剪英文单词。
  2. 带有分段(换行)的字符串,可以自行决定保留原分段,还是无视分段,重新合并裁剪。
  3. 整句判断标识(默认中文标点符号)、段落处理、采集长度等均可自定义。

Warning

:warning: 请使用 utf-8编码。

:warning: 本项目抽离于本人的其他生产项目,本着方便易用的原则,实际使用了各类字符串函数和方法达到分割效果,虽考虑了效率的处理,但仅建议使用在小文本的截剪处理上,理论上万字以内的效率和内存开销均在可控范围内。不建议直接处理万字以上的大段文本,请结合实际情况自行考量使用效率和内存开销。

:warning: 仅能处理字符串,不能直接处理包含html标签的字符串,为保证结果,会直接清理掉 html标签!

Installing

Usage

Demo

常规用法:

静态方法:

各参数可通过链式调用自定义:

License

MIT


All versions of cut_elegant_string with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package wangqs/cut_elegant_string contains the following files

Loading the files please wait ....