• PHP生成名片、网址二维码


    php生成名片(vcard)二维码:

    <?php
    $vname = 'test';  
    $vtel = '13800000000';  
    generateQRfromGoogle($vname,$vtel);

    function generateQRfromGoogle($vname,$vtel,$widhtHeight ='150',$EC_level='L',$margin='0')
    {
        if($vname&&$vtel){  
           $chl = "BEGIN:VCARD VERSION:3.0". //vcard头信息  
           " FN:$vname".  
           " TEL:$vtel".  
           " END:VCARD"; //vcard尾信息  
           echo '<img src="http://chart.apis.google.com/chart?chs='.$widhtHeight.'x'.$widhtHeight.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.urlencode($chl).'" alt="QR code" widhtHeight="'.$size.'" widhtHeight="'.$size.'"/>';
        }
    }
    ?>

    php生成网址二维码:

    <?php
    $url = "http://www.google.com.hk"; 
    generateQRfromGoogle($url);

    function generateQRfromGoogle($chl,$widhtHeight ='150',$EC_level='L',$margin='0')
    {
           echo '<img src="http://chart.apis.google.com/chart?chs='.$widhtHeight.'x'.$widhtHeight.'&cht=qr&chld='.$EC_level.'|'.$margin.'&chl='.urlencode($chl).'" alt="QR code" widhtHeight="'.$size.'" widhtHeight="'.$size.'"/>';
    }
    ?>

  • 相关阅读:
    Kafka 高级API 实战
    CDH 5.16.1 离线安装 Spark 2.3
    CDH5.16.1 离线安装 Kafka
    CDH5.16.1新增节点
    mysql搭建主从结构
    Kerberos常见错误
    expect实现脚本的 自动交互
    寒假day27
    寒假day26
    寒假day25
  • 原文地址:https://www.cnblogs.com/rainblack/p/5600540.html
Copyright © 2020-2023  润新知