I am trying to convert PHP array to YAML. I want the the desired output to be without wordwrap but yaml_emit() break the lines into multiple lines. I want the string to remain in one line.
---
bill: William Henry Gates III is an American business magnate, software developer,
investor, author, and philanthropist. He is the co-founder of Microsoft Corporation.
steve: Steven Paul Jobs was an American business magnate, industrial designer, investor,
and media proprietor.
...
Desired output:
---
bill: William Henry Gates III is an American business magnate, software developer, investor, author, and philanthropist. He is the co-founder of Microsoft Corporation.
steve: Steven Paul Jobs was an American business magnate, industrial designer, investor, and media proprietor.
...
Does anyone know who to achieve that? Here's the code:
<?php
$array = array(
'bill' => 'William Henry Gates III is an American business magnate, software developer, investor, author, and philanthropist. He is the co-founder of Microsoft Corporation.',
'steve' => 'Steven Paul Jobs was an American business magnate, industrial designer, investor, and media proprietor.'
);
file_put_contents('bio.yaml', yaml_emit($array));
?>