downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

yaml_parse_url> <yaml_emit
[edit] Last updated: Fri, 25 May 2012

view this page in

yaml_parse_file

(PECL yaml >= 0.4.0)

yaml_parse_fileファイルからの YAML ストリームをパースする

説明

mixed yaml_parse_file ( string $filename [, int $pos = 0 [, int &$ndocs [, array $callbacks ]]] )

指定したファイルから読み込んだ YAML ドキュメントストリーム全体あるいはその一部を、PHP の変数に変換します。

パラメータ

filename

ファイルへのパス。

pos

ストリームから取り出すドキュメント (-1 はすべてのドキュメント、0 は最初のドキュメント、...)。

ndocs

ndocs を渡すと、 ストリーム内で見つかったドキュメントの数がそこに格納されます。

callbacks

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

返り値

適切な PHP の型に変換した結果を返します。 失敗した場合に FALSE を返します。 pos-1 の場合は配列を返します。 配列の各要素が、ストリーム内で見つかった個々のドキュメントとなります。

参考



add a note add a note User Contributed Notes yaml_parse_file
Jesse Donat 10-Aug-2011 03:34
This is entirely dependent on type detection - as far as I can find there is no way to force a type and for instance when you have a very long integer as a value - in my case 1313035348823 it gets limited to 2147483647 - PHP's max integer.

 
show source | credits | stats | sitemap | contact | advertising | mirror sites