<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; $TOC = array(); $TOC_DEPRECATED = array(); $PARENTS = array(); include_once dirname(__FILE__) ."/toc/class.splfileobject.inc"; $setup = array ( 'home' => array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'splfileobject.tostring.php', 1 => 'SplFileObject::__toString', 2 => 'Returns the current line as a string', ), 'up' => array ( 0 => 'class.splfileobject.php', 1 => 'SplFileObject', ), 'prev' => array ( 0 => 'splfileobject.setmaxlinelen.php', 1 => 'SplFileObject::setMaxLineLen', ), 'next' => array ( 0 => 'splfileobject.valid.php', 1 => 'SplFileObject::valid', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/spl/splfileobject/tostring.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?> <div id="splfileobject.tostring" class="refentry"> <div class="refnamediv"> <h1 class="refname">SplFileObject::__toString</h1> <p class="verinfo">(PHP 5 >= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">SplFileObject::__toString</span> — <span class="dc-title">Returns the current line as a string</span></p> </div> <div class="refsect1 description" id="refsect1-splfileobject.tostring-description"> <h3 class="title">说明</h3> <div class="methodsynopsis dc-description"> <span class="modifier">public</span> <span class="methodname"><strong>SplFileObject::__toString</strong></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div> <p class="para rdfs-comment"> This method will return the current line as a string. </p> </div> <div class="refsect1 parameters" id="refsect1-splfileobject.tostring-parameters"> <h3 class="title">参数</h3> <p class="para">此函数没有参数。</p> </div> <div class="refsect1 returnvalues" id="refsect1-splfileobject.tostring-returnvalues"> <h3 class="title">返回值</h3> <p class="para"> Returns the current line as a string. </p> </div> <div class="refsect1 changelog" id="refsect1-splfileobject.tostring-changelog"> <h3 class="title">更新日志</h3> <p class="para"> <table class="doctable informaltable"> <thead> <tr> <th>版本</th> <th>说明</th> </tr> </thead> <tbody class="tbody"> <tr> <td>8.1.14, 8.2.1</td> <td> Changed from an alias of <span class="methodname"><a href="splfileobject.fgets.php" class="methodname">SplFileObject::fgets()</a></span> to an implementation of <span class="methodname"><a href="splfileobject.current.php" class="methodname">SplFileObject::current()</a></span> which returns a CSV string when the <strong><code><a href="class.splfileobject.php#splfileobject.constants.read-csv">SplFileObject::READ_CSV</a></code></strong> flag is set. </td> </tr> <tr> <td>7.2.19, 7.3.6</td> <td> Changed from an alias of <span class="methodname"><a href="splfileobject.current.php" class="methodname">SplFileObject::current()</a></span> to an alias of <span class="methodname"><a href="splfileobject.fgets.php" class="methodname">SplFileObject::fgets()</a></span>. </td> </tr> </tbody> </table> </p> </div> </div><?php manual_footer($setup); ?>