VCard
UseQrCode::VCard(array $config) to produce a vCard 3.0 payload. VCard is the most widely supported contact format across iOS, Android, and desktop mail clients, making it the safest default choice for business cards, event badges, and printed marketing materials.
Supported Keys
The full display name of the contact (
FN field). This is the only required
key.The contact’s given name. Used alongside
lastName to populate the structured
N field.The contact’s family name.
If
firstName and lastName are provided, they will automatically construct
the structured N field in the VCard, while name populates the FN
(Formatted Name) field.A general internet email address.
A work-typed internet email address (
EMAIL;type=INTERNET,WORK).A home-typed internet email address (
EMAIL;type=INTERNET,HOME).A general phone number (
TEL).A work-typed phone number (
TEL;type=WORK).A home-typed phone number (
TEL;type=HOME).A mobile/cell phone number (
TEL;type=CELL).The organisation name (
ORG).The job title (
TITLE).The role within the organisation (
ROLE).A street address (
ADR).A personal or company website URL (
URL).A free-text note (
NOTE).Date of birth in
YYYYMMDD format (BDAY).Example
Always wrap in
try/catch when using user-supplied data. The only hard
requirement is a non-empty name; all other keys are optional.MeCard
UseQrCode::MeCard(string $name, ...) to produce a MeCard payload. MeCard is a lighter-weight format originating from NTT DoCoMo and is prevalent in Japan and some Asian markets. It carries slightly fewer fields than vCard but produces a shorter payload, resulting in a less complex QR code.
Signature
Example
VCard vs MeCard — Which Should You Use?
| VCard 3.0 | MeCard | |
|---|---|---|
| Compatibility | iOS, Android, Outlook, macOS — universally supported | Excellent on Android; supported on iOS 11+; less so on desktop |
| Fields | Rich: multiple emails, phone types, role, birthday, notes | Core fields only: name, phone, email, URL, address, note |
| Payload size | Larger (more verbose) | Smaller (shorter QR code at the same error-correction level) |
| Best for | Business cards, event badges, marketing collateral | Simple personal cards, space-constrained prints |