<?php include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc'; $TOC = array(); $TOC_DEPRECATED = array(); $PARENTS = array(); include_once dirname(__FILE__) ."/toc/ref.yaml.inc"; $setup = array ( 'home' => array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'zh', ), 'this' => array ( 0 => 'function.yaml-emit-file.php', 1 => 'yaml_emit_file', 2 => 'Send the YAML representation of a value to a file', ), 'up' => array ( 0 => 'ref.yaml.php', 1 => 'Yaml 函数', ), 'prev' => array ( 0 => 'function.yaml-emit.php', 1 => 'yaml_emit', ), 'next' => array ( 0 => 'function.yaml-parse.php', 1 => 'yaml_parse', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/yaml/functions/yaml-emit-file.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?> <div id="function.yaml-emit-file" class="refentry"> <div class="refnamediv"> <h1 class="refname">yaml_emit_file</h1> <p class="verinfo">(PECL yaml >= 0.5.0)</p><p class="refpurpose"><span class="refname">yaml_emit_file</span> — <span class="dc-title">Send the YAML representation of a value to a file</span></p> </div> <div class="refsect1 description" id="refsect1-function.yaml-emit-file-description"> <h3 class="title">说明</h3> <div class="methodsynopsis dc-description"> <span class="methodname"><strong>yaml_emit_file</strong></span>(<br> <span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$filename</code></span>,<br> <span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">$data</code></span>,<br> <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$encoding</code><span class="initializer"> = YAML_ANY_ENCODING</span></span>,<br> <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$linebreak</code><span class="initializer"> = YAML_ANY_BREAK</span></span>,<br> <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$callbacks</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div> <p class="para rdfs-comment"> Generate a YAML representation of the provided <code class="parameter">data</code> in the <code class="parameter">filename</code>. </p> </div> <div class="refsect1 parameters" id="refsect1-function.yaml-emit-file-parameters"> <h3 class="title">参数</h3> <p class="para"> <dl> <dt><code class="parameter">filename</code></dt> <dd> <p class="para"> Path to the file. </p> </dd> <dt><code class="parameter">data</code></dt> <dd> <p class="para"> The <code class="parameter">data</code> being encoded. Can be any type except a <span class="type"><a href="language.types.resource.php" class="type resource">resource</a></span>. </p> </dd> <dt><code class="parameter">encoding</code></dt> <dd> <p class="para"> Output character encoding chosen from <strong><code><a href="yaml.constants.php#constant.yaml-any-encoding">YAML_ANY_ENCODING</a></code></strong>, <strong><code><a href="yaml.constants.php#constant.yaml-utf8-encoding">YAML_UTF8_ENCODING</a></code></strong>, <strong><code><a href="yaml.constants.php#constant.yaml-utf16le-encoding">YAML_UTF16LE_ENCODING</a></code></strong>, <strong><code><a href="yaml.constants.php#constant.yaml-utf16be-encoding">YAML_UTF16BE_ENCODING</a></code></strong>. </p> </dd> <dt><code class="parameter">linebreak</code></dt> <dd> <p class="para"> Output linebreak style chosen from <strong><code><a href="yaml.constants.php#constant.yaml-any-break">YAML_ANY_BREAK</a></code></strong>, <strong><code><a href="yaml.constants.php#constant.yaml-cr-break">YAML_CR_BREAK</a></code></strong>, <strong><code><a href="yaml.constants.php#constant.yaml-ln-break">YAML_LN_BREAK</a></code></strong>, <strong><code><a href="yaml.constants.php#constant.yaml-crln-break">YAML_CRLN_BREAK</a></code></strong>. </p> </dd> <dt><code class="parameter">callbacks</code></dt> <dd> <p class="para"> Content handlers for emitting YAML nodes. Associative <span class="type"><a href="language.types.array.php" class="type array">array</a></span> of classname => <span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> mappings. See <a href="yaml.callbacks.emit.php" class="link">emit callbacks</a> for more details. </p> </dd> </dl> </p> </div> <div class="refsect1 returnvalues" id="refsect1-function.yaml-emit-file-returnvalues"> <h3 class="title">返回值</h3> <p class="para"> Returns <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> on success. </p> </div> <div class="refsect1 changelog" id="refsect1-function.yaml-emit-file-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>PECL yaml 1.1.0</td> <td> The <code class="parameter">callbacks</code> parameter was added. </td> </tr> </tbody> </table> </p> </div> <div class="refsect1 seealso" id="refsect1-function.yaml-emit-file-seealso"> <h3 class="title">参见</h3> <p class="para"> <ul class="simplelist"> <li><span class="function"><a href="function.yaml-emit.php" class="function" rel="rdfs-seeAlso">yaml_emit()</a> - Returns the YAML representation of a value</span></li> <li><span class="function"><a href="function.yaml-parse.php" class="function" rel="rdfs-seeAlso">yaml_parse()</a> - Parse a YAML stream</span></li> </ul> </p> </div> </div><?php manual_footer($setup); ?>