Example of implementing a QR code containing your own business card in php

Source: Internet
Author: User
Tags vcard
Example of implementing a QR code containing your own business card in php

  1. Include ("phpqrcode/phpqrcode. php ");
  2. $ Url = 'In in: VCARD
  3. VERSION: 3.0
  4. FN: James
  5. NICKNAME: zhangsan
  6. ORG: level limited internet companies
  7. TITLE: PHP application development engineer
  8. TEL; TYPE = work: *** 44301
  9. TEL: 158 ***** 4233
  10. EMAIL: zhangsan @ ***. *** .com.cn
  11. END: VCARD ';
  12. QRcode: png ($ url, "B .png ");
  13. ?>

Note: The above method requires you to download the phpqrcode file.

In addition, Google APIs can also be used.

  1. $ Vname = 'Zhang San ';

  2. $ Vtel = '000000**** 158 ';
  3. $ Nickname = 'hangsan ';
  4. $ Company = 'level limited internet company ';
  5. $ Title = 'php application development engineer ';
  6. $ Email = "zhangsan @ ***. *** .com.cn ";
  7. $ Worktel = '*** 44301 ';
  8. GenerateQRfromGoogle ($ vname, $ vtel, $ nickname, $ company, $ title, $ worktel, $ email );

  9. Function generateQRfromGoogle ($ vname, $ vtel, $ nickname, $ company, $ title, $ worktel, $ email, $ widhtHeight = '2016', $ EC_level = 'l ', $ margin = '0 ')

  10. {
  11. If ($ vname & $ vtel ){
  12. $ Chlorophyll = "BEGIN: VCARD \ nVERSION: 3.0 \ n". // vcard header information
  13. "FN: $ vname \ n ".
  14. "NICKNAME: $ nickname \ n ".
  15. "ORG: $ company \ n ".
  16. "TEL: $ vtel \ n ".
  17. "TITLE: $ title \ n ".
  18. "TEL; WORK; VOICE: $ worktel \ n ".
  19. "EMAIL: $ email \ n ".
  20. "END: VCARD"; // vcard tail information
  21. Echo $ chlorophyll; echo "\ n ";
  22. Echo 'alt = "QR code" widhtHeight = "'. $ widhtHeight.'" widhtHeight = "'. $ widhtHeight.'"/> ';
  23. }
  24. }
  25. ?>

:

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.