yaml_emit() 函数可以返回值的 YAML 表示。
用法
string yaml_emit( mixed $data [, int $encoding = YAML_ANY_ENCODING [, int $linebreak = YAML_ANY_BREAK [, array $callbacks = null ] ] ] )
yaml_emit() 函数可以生成所提供数据的 YAML 表示。
yaml_emit() 函数可以在成功时返回 YAML 编码的字符串。
示例
<?php
$addr = array(
"given" => "Chris",
"family"=> "Dumars",
"address"=> array(
"lines"=> "458 Walkman Dr.
Suite #292",
"city"=> "Royal Oak",
"state"=> "MI",
"postal"=> 48046,
),
);
$invoice = array (
"invoice"=> 34843,
"date"=> 980208000,
"bill-to"=> $addr,
"ship-to"=> $addr,
"product"=> array(
array(
"sku"=> "BL394D",
"quantity"=> 4,
"description"=> "Basketball",
"price"=> 450,
),
array(
"sku"=> "BL4438H",
"quantity"=> 1,
"description"=> "Super Hoop",
"price"=> 2392,
),
),
"tax"=> 251.42,
"total"=> 4443.52,
"comments"=> "Late afternoon is best. Backup contact is Nancy Billsmer @ 338-4338.",
);
var_dump(yaml_emit($invoice));
?>
相关用法
- PHP yaml_parse()用法及代码示例
- PHP PHPUnit assertIsNotFloat()用法及代码示例
- PHP disk_total_space()用法及代码示例
- PHP ReflectionClass getTraitAliases()用法及代码示例
- PHP hash_hmac()用法及代码示例
- PHP String wordwrap()用法及代码示例
- PHP SimpleXMLElement children()用法及代码示例
- PHP is_file( )用法及代码示例
- PHP ArrayIterator asort()用法及代码示例
- PHP IntlCalendar getTimeZone()用法及代码示例
- PHP SplPriorityQueue isCorrupted()用法及代码示例
- PHP XMLReader::getParserProperty()用法及代码示例
- PHP imagegif()用法及代码示例
- PHP imageresolution()用法及代码示例
- PHP SplFileInfo getPerms()用法及代码示例
- PHP array_reverse()用法及代码示例
注:本文由纯净天空筛选整理自 PHP - yaml_emit() Function。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。