Skip to main content
Contact data types encode personal and professional details into a QR code that any modern smartphone camera app can parse and offer to save as a new contact. The package supports two standards: VCard (RFC 6350 / version 3.0) and MeCard (NTT DoCoMo format). Both let a user scan once and skip the manual entry entirely.

VCard

Use QrCode::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

string
required
The full display name of the contact (FN field). This is the only required key.
string
The contact’s given name. Used alongside lastName to populate the structured N field.
string
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.
string
A general internet email address.
string
A work-typed internet email address (EMAIL;type=INTERNET,WORK).
string
A home-typed internet email address (EMAIL;type=INTERNET,HOME).
string
A general phone number (TEL).
string
A work-typed phone number (TEL;type=WORK).
string
A home-typed phone number (TEL;type=HOME).
string
A mobile/cell phone number (TEL;type=CELL).
string
The organisation name (ORG).
string
The job title (TITLE).
string
The role within the organisation (ROLE).
string
A street address (ADR).
string
A personal or company website URL (URL).
string
A free-text note (NOTE).
string
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

Use QrCode::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?

When in doubt, choose VCard. It is more widely supported and handles multiple phone numbers and email addresses in a single payload.