VCard

PHP library to generate and parse vCard (.vcf) contact files

Library
Composer
vv1.7.4
517stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
48/100Fair
Development Activity8
Maintenance20
Community84
Maturity60
Momentum20

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
72/100Good
Architecture68
Code Quality70
Innovation60
Learning Curve88

VCard is a PHP library for building and reading vCard files, the standard format for electronic contact cards. It provides a fluent API to assemble a contact from names, companies, job titles, phone numbers, emails, addresses, URLs, and photos, then output it as a string, save it, or serve it as a download.

The library handles device quirks, such as exporting an .ics file for older iOS versions that do not support .vcf, and includes a parser for reading vCard data back into structured objects. It is a lightweight, dependency-light package suitable for contact export features in any PHP application.

What You Get

  • A fluent VCard builder covering names, companies, phones, emails, addresses, and URLs
  • Photo embedding from local files or remote URLs
  • Output as a string, saved file, or browser download response
  • Automatic .ics fallback for older iOS devices that reject .vcf
  • A VCardParser for reading vCard data back into structured values

Common Use Cases

  • Adding a ‘download my contact card’ button to a website or profile page
  • Exporting user or team contact details from a CRM or directory
  • Generating vCards in bulk from a database of contacts

Under The Hood

Architecture - The library is intentionally tiny: src/VCard.php holds the builder that accumulates fields into internal properties and assembles the RFC-style vCard text via getOutput(), with save()/download() handling delivery and content-type headers; src/VCardParser.php reads vCard content back into structured values, and src/VCardException.php provides typed errors. Photo handling resolves local paths or remote URLs before embedding.

Tech Stack - Plain PHP distributed via Composer under the JeroenDesloovere\VCard namespace, with essentially no runtime dependencies. Dev tooling includes PHPUnit (phpunit.xml.dist) and historically Travis CI and Scrutinizer.

Code Quality - A tests/ suite with PHPUnit covers generation and parsing, and examples/ demonstrate real usage. The code is straightforward and readable; the project is mature but in low-activity maintenance, with a 4.0 rewrite explored on a branch.

API Design - The add* builder pattern reads almost like prose (addName, addEmail, addPhoneNumber, addPhoto) and the three output methods (getOutput/save/download) cover the common delivery paths, so getting a working contact card takes only a few lines with a shallow learning curve.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search