博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
chunk_split_PHP chunk_split()函数与示例
阅读量:2532 次
发布时间:2019-05-11

本文共 1172 字,大约阅读时间需要 3 分钟。

chunk_split

PHP chunk_split()函数 (PHP chunk_split() function)

chunk_split() function is used to split the given string into chunks of small parts, it accepts the string returns the parts of the strings specified by the other parameters.

chunk_split()函数用于将给定的字符串分割成小块,它接受该字符串返回其他参数指定的字符串部分。

Syntax:

句法:

chunk_split(string, [chunklen], [end_characters]);

Here,

这里,

  • string - is the source string

    string-是源字符串

  • chunklen - is an optional parameter, it defines the number of characters of the chunks. It's default value is 75.

    chunklen-是一个可选参数,它定义块的字符数。 默认值为75。

  • end_characters - is also an optional parameter, it defines the end characters that will be added to the each chunk, and its default value is "\r\n".

    end_characters-也是一个可选参数,它定义了将添加到每个块中的结束字符,其默认值为“ \ r \ n” 。

Examples:

例子:

Input:     str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"    Function call: chunk_split(str, 3, "...");    Output:    ABCD...EFGH...IJKL...MNOP...QRST...UVWX...YZ...

PHP code:

PHP代码:

Output

输出量

The extracted characters are...ABCDEFGHIJKLMNOPQRSTUVWXYZThe extracted characters are...ABCDEFGHIJKLMNOPQRSTUVWXYZThe extracted characters are...ABCD...EFGH...IJKL...MNOP...QRST...UVWX...YZ...

翻译自:

chunk_split

转载地址:http://sxtzd.baihongyu.com/

你可能感兴趣的文章
实验二
查看>>
shell——按指定列排序
查看>>
crash 收集
查看>>
507 LOJ 「LibreOJ NOI Round #1」接竹竿
查看>>
UI基础--烟花动画
查看>>
2018. 2.4 Java中集合嵌套集合的练习
查看>>
精通ASP.NET Web程序测试
查看>>
vue 根据不同属性 设置背景
查看>>
51Nod1601 完全图的最小生成树计数 Trie Prufer编码
查看>>
Codeforces 1110D. Jongmah 动态规划
查看>>
android驱动在win10系统上安装的心酸历程
查看>>
优雅的程序员
查看>>
oracle之三 自动任务调度
查看>>
Android dex分包方案
查看>>
ThreadLocal为什么要用WeakReference
查看>>
删除本地文件
查看>>
FOC实现概述
查看>>
base64编码的图片字节流存入html页面中的显示
查看>>
这个大学时代的博客不在维护了,请移步到我的新博客
查看>>
GUI学习之二十一——QSlider、QScroll、QDial学习总结
查看>>