yaml_emit_file

(PECL yaml >= 0.5.0)

yaml_emit_file — YAML 形式にした値をファイルに送る

説明

function yaml_emit_file(
    string $filename,
    mixed $data,
    int $encoding = YAML_ANY_ENCODING,
    int $linebreak = YAML_ANY_BREAK,
    array $callbacks = null
): bool

data で渡したデータを YAML 形式にして filename に書き込みます。

パラメータ

filename

ファイルへのパス。

data

エンコードしたいデータ。リソース型以外の任意の型が使えます。

encoding

出力時の文字エンコーディング。 YAML_ANY_ENCODING、 YAML_UTF8_ENCODING、 YAML_UTF16LE_ENCODING、 YAML_UTF16BE_ENCODING のいずれか。

linebreak

出力時の改行形式。 YAML_ANY_BREAK、 YAML_CR_BREAK、 YAML_LN_BREAK、 YAML_CRLN_BREAK のいずれか。

callbacks

YAML ノードの発行用のコンテンツハンドラ。 クラス名 => callable 形式の連想配列となります。 詳細は発行コールバック を参照ください。

戻り値

成功した場合に true を返します。

変更履歴

バージョン 説明
PECL yaml 1.1.0 callbacks パラメータが追加されました。

参考

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top