Reputation: 91213
How would one use PHP (and whatever necessary libraries) to convert JSON data to Plist data?
Upvotes: 0
Views: 1582
Reputation: 50982
Transfer it into an array first. After that, do whatever you want with that
json_decode($json);
Upvotes: 1
Reputation: 58371
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();
Upvotes: 2