add( $dict = new CFDictionary() );
// Year Of Birth1965
$dict->add( 'Year Of Birth', new CFNumber( 1965 ) );
// Date Of Graduation2004-06-22T19:23:43Z
$dict->add( 'Date Of Graduation', new CFDate( gmmktime( 19, 23, 43, 06, 22, 2004 ) ) );
// Pets Names
$dict->add( 'Pets Names', new CFArray() );
// PicturePEKBpYGlmYFCPA==
// to keep it simple we insert an already base64-encoded string
$dict->add( 'Picture', new CFData( 'PEKBpYGlmYFCPA==', true ) );
// City Of BirthSpringfield
$dict->add( 'City Of Birth', new CFString( 'Springfield' ) );
// NameJohn Doe
$dict->add( 'Name', new CFString( 'John Doe' ) );
// Kids NamesJohnKyra
$dict->add( 'Kids Names', $array = new CFArray() );
$array->add( new CFString( 'John' ) );
$array->add( new CFString( 'Kyra' ) );
/*
* Save PList as XML
*/
$plist->saveXML( __DIR__.'/example-create-01.xml.plist' );
/*
* Save PList as Binary
*/
$plist->saveBinary( __DIR__.'/example-create-01.binary.plist' );
?>