Server : LiteSpeed System : Linux server335.web-hosting.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64 User : cardxfeb ( 2452) PHP Version : 8.1.34 Disable Function : NONE Directory : /home/cardxfeb/public_html/vendor/jeroendesloovere/vcard/examples/ |
<?php
/**
* VCardParser test - can parse bundled VCF file into CSV
*/
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../src/VCardParser.php';
// load VCardParser classes
use JeroenDesloovere\VCard\VCardParser;
$pathToVCardExample = __DIR__ . '/assets/contacts.vcf';
$parser = VCardParser::parseFromFile($pathToVCardExample);
foreach($parser as $vcard) {
$lastname = $vcard->lastname;
$firstname = $vcard->firstname;
$birthday = $vcard->birthday->format('Y-m-d');
printf("\"%s\",\"%s\",\"%s\"", $lastname, $firstname, $birthday);
echo PHP_EOL;
}