Introduction to the usage of chunk_split() function in php
Jul 25, 2016 am 08:58 AM
This article introduces the usage of the chunk_split() function in PHP. Friends in need can refer to it.
Definition and usage chunk_split function splits a string into a series of smaller parts. Grammar chunk_split(string,length,end) Parameter Description string required. Specifies the string to be split. length is optional. A number defining the length of the string block. end is optional. A string value that defines what is placed after each string block. Tips and Notes Note: This function does not change the original string. Example 1, separate each character and add ".": <?php $str = "Hello world!"; echo chunk_split($str,1,"."); //by bbs.it-home.org ?> Copy after login Output: H.e.l.l.o. .w.o.r.l.d.!. Example 2, split the string once after six characters and add "...": <?php $str = "Hello world!"; echo chunk_split($str,6,"..."); //by bbs.it-home.org ?> Copy after login Output: Hello...world!... |

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

11 Best PHP URL Shortener Scripts (Free and Premium)

Working with Flash Session Data in Laravel

Build a React App With a Laravel Back End: Part 2, React

Simplified HTTP Response Mocking in Laravel Tests

cURL in PHP: How to Use the PHP cURL Extension in REST APIs

12 Best PHP Chat Scripts on CodeCanyon
