Location: PHPKode > scripts > IMC Objects > imc-objects/test_vcard.php
<?

require_once('class.imcVCard.php');

// Stand alone vCard object.
$vcard = new imc_vCard();
$vcard->setNameSuffix('Mr.');
$vcard->setGivenName('Andreas');
$vcard->setFamilyName('Haberstroh');
$vcard->setFN('Andreas Haberstroh');
$vcard->setPostOfficeAddress('', array('DOM','HOME') );
$vcard->setExtendedAddress('', array('DOM','HOME') );
$vcard->setStreetAddress('341 N. Bitterbush St.', array('DOM','HOME') );
$vcard->setLocality('Orange', array('DOM','HOME') );
$vcard->setRegion('CA', array('DOM','HOME') );
$vcard->setPostalCode('92868', array('DOM','HOME') );
$vcard->setCountry('USA', array('DOM','HOME') );
$vcard->setTelephone('714-532-9493', true, array('HOME') );

$fh = fopen('test_vcard.vcf', 'w');

$imcComponent = new imcComponent;
$imcComponent->writeFile($fh);
fclose($fh);



print("<h1>vCard Object Usage</h1>");
print("<pre>");
print_r( $vcard );
print("</pre>");

$fh = fopen('sample.vcf', 'r');

$imcComponent = new imcComponent;
$imcComponent->readFile($fh);
fclose($fh);
print("<h1>vCard Component Usage</h1>");
print("<pre>");
print_r( $imcComponent );
print("</pre>");



?>
Return current item: IMC Objects