PHP - Convert JSON to Plist?
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);
精彩评论