⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 function.chunk-split.html

📁 php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容
💻 HTML
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Split a string into smaller chunks</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.chr.html">chr</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.convert-cyr-string.html">convert_cyr_string</a></div> <div class="up"><a href="ref.strings.html">String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="function.chunk-split" class="refentry"> <div class="refnamediv">  <h1 class="refname">chunk_split</h1>  <p class="verinfo">(PHP 4, PHP 5)</p><p class="refpurpose"><span class="refname">chunk_split</span> &mdash; <span class="dc-title">Split a string into smaller chunks</span></p> </div>  <div class="refsect1 description">  <h3 class="title">Description</h3>  <div class="methodsynopsis dc-description">   <span class="type">string</span> <span class="methodname"><b><b>chunk_split</b></b></span>    ( <span class="methodparam"><span class="type">string</span> <tt class="parameter">$body</tt></span>   [, <span class="methodparam"><span class="type">int</span> <tt class="parameter">$chunklen</tt></span>   [, <span class="methodparam"><span class="type">string</span> <tt class="parameter">$end</tt></span>  ]] )</div>  <p class="para rdfs-comment">   Can be used to split a string into smaller chunks which is useful for   e.g. converting <a href="function.base64-encode.html" class="function">base64_encode()</a> output to match RFC   2045 semantics. It inserts <i><tt class="parameter">end</tt></i> every    <i><tt class="parameter">chunklen</tt></i> characters.  </p> </div> <div class="refsect1 parameters">  <h3 class="title">Parameters</h3>  <p class="para">   <dl>    <dt>     <span class="term"><i><tt class="parameter">body</tt></i></span>     <dd>      <p class="para">       The string to be chunked.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">chunklen</tt></i></span>     <dd>      <p class="para">       The chunk length. Defaults to 76.      </p>     </dd>    </dt>    <dt>     <span class="term"><i><tt class="parameter">end</tt></i></span>     <dd>      <p class="para">       The line ending sequence. Defaults to &quot;\r\n&quot;.      </p>     </dd>    </dt>   </dl>  </p> </div> <div class="refsect1 returnvalues">  <h3 class="title">Return Values</h3>  <p class="para">   Returns the chunked string.  </p> </div> <div class="refsect1 examples">  <h3 class="title">Examples</h3>  <p class="para">   <div class="example">    <p><b>Example #1 <b>chunk_split()</b> example</b></p>    <div class="example-contents"><div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">//&nbsp;format&nbsp;$data&nbsp;using&nbsp;RFC&nbsp;2045&nbsp;semantics<br /></span><span style="color: #0000BB">$new_string&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">chunk_split</span><span style="color: #007700">(</span><span style="color: #0000BB">base64_encode</span><span style="color: #007700">(</span><span style="color: #0000BB">$data</span><span style="color: #007700">));<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>    </div>   </div>  </p> </div>  <div class="refsect1 seealso">  <h3 class="title">See Also</h3>  <p class="para">   <ul class="simplelist">    <li class="member"><a href="function.str-split.html" class="function" rel="rdfs-seeAlso">str_split()</a></li>    <li class="member"><a href="function.explode.html" class="function" rel="rdfs-seeAlso">explode()</a></li>    <li class="member"><a href="function.split.html" class="function" rel="rdfs-seeAlso">split()</a></li>    <li class="member"><a href="function.wordwrap.html" class="function" rel="rdfs-seeAlso">wordwrap()</a></li>    <li class="member"><a href="http://www.faqs.org/rfcs/rfc2045" class="link external">&raquo; RFC 2045</a></li>   </ul>  </p> </div></div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="function.chr.html">chr</a></div> <div class="next" style="text-align: right; float: right;"><a href="function.convert-cyr-string.html">convert_cyr_string</a></div> <div class="up"><a href="ref.strings.html">String Functions</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -