开发者

PHP - Convert JSON to Plist?

开发者 https://www.devze.com 2023-04-05 19:27 出处:网络
How w开发者_运维技巧ould one use PHP (and whatever necessary libraries) to convert JSON data to Plist data?I would decode the data and then encode it using CFPropertyList

How w开发者_运维技巧ould one use PHP (and whatever necessary libraries) to convert JSON data to Plist data?


I would decode the data and then encode it using CFPropertyList

Simply:

$plist = new CFPropertyList();    
$td = new CFTypeDetector();  
$guessedStructure = $td->toCFType( json_decode($json) );
$plist->add( $guessedStructure );
$xml = $plist->toXML();


Transfer it into an array first. After that, do whatever you want with that

json_decode($json);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号