Downloads
Stars
Version
VCard PHP library. Only VCF files.
composer require rogersxd/vcard
This will install the latest version of vcard with Composer
use Rogersxd\VCard\VCard;
$vcard = new VCard();
$vcard->addPhoto(__DIR__ .'/images/rogerscorrea.jpg');
$lastName = 'CorrĂȘa';
$firstName = 'Rogers';
$additional = '';
$prefix = '';
$suffix = '';
$fullName = true;
$vcard->addnames(
$lastName,
$firstName,
$additional,
$prefix,
$suffix,
$fullName
);
$vcard->addPhone('+5551999999999', 'CELL');
$vcard->addPhone('+555133333333', 'HOME');
$vcard->addJobtitle('Banking');
$vcard->addRole('Developer');
$vcard->addEmail('[email protected]');
$vcard->addCompany('XYZ');
$vcard->addUrl('http://rogerscorrea.wordpress.com');
$vcard->addUrl('https://github.com/rogersxd');
$vcard->addNote('CUSTOM-NOTE: TEST VCARD');
$vcard->addBirthday('YYYY-MM-DD');
$name = '';
$extended = '';
$street = 'Francisco Martins, 123';
$city = 'Porto Alegre';
$region = 'RS';
$zip = '91712-150';
$country = 'BR';
$type = 'HOME';
$vcard->addAddress(
$name,
$extended,
$street,
$city,
$region,
$zip,
$country,
$type
);
$socialProfile1 = 'https://facebook.com/';
$typeSocialProfile1 = 'facebook';
$socialProfile2 = 'https://instagram.com/';
$typeSocialProfile2 = 'instagram';
$socialProfile3 = 'https://twitter.com/';
$typeSocialProfile3 = 'twitter';
$socialProfile4 = 'https://linkedin.com/';
$typeSocialProfile4 = 'linkedin';
$vcard->addSocialProfile(
$socialProfile1,
$typeSocialProfile1
);
$vcard->addSocialProfile(
$socialProfile2,
$typeSocialProfile2
);
$vcard->addSocialProfile(
$socialProfile3,
$typeSocialProfile3
);
$vcard->addSocialProfile(
$socialProfile4,
$typeSocialProfile4
);
$vcard->addCustom('X-CUSTOM(CHARSET=UTF-8,ENCODING=QUOTED-PRINTABLE,Custom1)','1');
$vcard->setSavePath(__DIR__. '/vcf/');
$vcard->save();
The class is well documented inline.
Contributions are welcome and will be fully credited.
To add or update code
For bug reporting or code discussions.
More info on how to work with GitHub on help.github.com.
The module is licensed under MIT. In short, this license allows you to do everything as long as the copyright statement stays present.