String function Library: Chunk_split

Source: Internet
Author: User
Keywords chunk_split php Chinese Function Handbook
Tags .mall aliyun function function library html http php php chinese function handbook

Chunk_split

(PHP3 >= 3.0.6, PHP4)

Chunk_split---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; Cut a string into small segments

Syntax: String chunk_split (String string [, int chunklen [, String end]]

Description:

Can be used to cut a string into small segments, such as the output of a base64_encode () to the RFC 2045 semantics. It inserts the parameter end (the default value is "\ r \ n") for each chunklen (76) character. It returns a new string, but does not change the original string.

Example:

<?php

# format $data using RFC 2045 semantics

$new _string = Chunk_split (Base64_encode ($data));

?>

This function is faster than ereg_replace ()

Note: This function is a new function in 3.0.6

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.