PHP  
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
search for in the  
<chrconvert_cyr_string>
Last updated: Mon, 16 Jul 2012

chunk_split

(PHP 3 >= 3.0.6, PHP 4, PHP 5)

chunk_split -- 将字符串分割成小块

描述

string chunk_split ( string body [, int chunklen [, string end]] )

使用此函数将字符串分割成小块非常有用。例如将 base64_encode 的输出转换成符合 RFC 2045 语义的字符串。它会在每 chunklen(默认为 76)个字符后边插入 end(默认为“\r\n”)。此函数会返回新的字符串,而不会修改原有字符串。

例子 1. chunk_split() 示例

<?php
// 使用 RFC 2045 语义格式化 $data
$new_string = chunk_split(base64_encode($data));
?>

参见 str_split()explode()split()wordwrap()RFC 2045




<chrconvert_cyr_string>
 Last updated: Mon, 16 Jul 2012
 
Copyright © 2001-2005 The PHP Group
All rights reserved.
This unofficial mirror is operated at: http://manual.phpv.net/
Last updated: Thu Jul 7 19:13:47 2005 CST