Skip to content

nikkimoreaux/vCard.php

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 

Repository files navigation

A very simple PHP vCard generator

With photo support.

Limitation: one phone/mail/address/url max.

Below, a complete implementation:

header("Content-type: text/x-vcard");
header("Content-Disposition: attachment; filename=\"john_doe.vcf\";");

require_once('vCard.php');

$vcard = new vCard;

$vcard->setName("John","Doe");

// Every set functions below are optional
$vcard->setTitle("Software dev.");
$vcard->setPhone("+1234567890");
$vcard->setURL("http://johndoe.com");
$vcard->setTwitter("diplodocus");
$vcard->setMail("[email protected]");
$vcard->setAddress(array(
	"street_address"   => "Main Street",
	"city"             => "Ghost Town",
	"state"            => "",
	"postal_code"      => "012345",
	"country_name"     => "Somewhere"
));
$vcard->setNote("Lorem Ipsum, \nWith new line.");
$vcard->setPhoto("john.jpg"); 

echo $vcard;

##License

This project is released under the MIT License.

About

A very simple PHP vCard generator

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages