vcard code example
Example: "data:text/vcard;
<?php
function raf_create_vcard(){
$format_name = utf8_encode($name);
$format_email = utf8_encode($email);
$format_tel = utf8_encode($tel);
$format_fax = utf8_encode($fax);
$format_www = utf8_encode($www);
$format_address = utf8_encode($address);
return 'BEGIN%3AVCARD%0D%0AVERSION%3A4.0%0D%0AN%3A%3B'.$format_name.'%3B%3B%3B%0D%0AFN%3A'.$format_name.'%0D%0AEMAIL%3A'.$format_email.'%0D%0AORG%3A'.$format_name.'%0D%0ATEL%3A'.$format_tel.'%0D%0ATEL%3Btype%3DFAX%3A'.$format_fax.'%0D%0AURL%3Btype%3Dpref%3A'.$format_www.'%0D%0AADR%3A%3B'.$format_address.'%3B%3B%3B%3B%3BSpain%0D%0AEND%3AVCARD';
}
?>
//Result
<a href="data:text/vcard;charset=UTF-8,<?php echo raf_create_vcard(); ?>" download="contact.vcf">Download</a>