“”data:text/vcard;” Code Answer

Loading

<?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>
Share This
0Shares

0
See also  “$age = 20; print ($age >= 18) ? "Adult" : "Not Adult";” Code Answer

Leave a Reply

Back to top of page

Register / Login

Message from SUPEDIUM


Welcome to SUPEDIUM, to ensure you have seamless experience when browsing our website, we encourage all users to register or login. It only takes less than 2 minutes to register an account :)

Register / Login with Email

Register / Login with Google

This will close in 30 seconds

Sign in

rotate_right

Send Message

image

My favorites

image