Heim > Fragen und Antworten > Hauptteil
如题:
var url = encodeURI( "http://www.baidu.com?username=18532232116&password=123456&cnName=飞翔的百度");
document.write("<img src='http://chart.apis.google.com/chart?cht=qr&chs=480x480&chl=\""+url+"\"'/>");
生成的结果很是让我无奈,只到了username 到&符号后就会自动被当成qr Code传递的参数。用引号包上然后再encode也不好用。在线求解。
PHPz2017-04-10 13:11:28
http://chart.apis.google.com/chart?cht=qr&chs=480x480&chl=http://www.baidu.com?username=18532232116%26password=123456%26cnName=飞翔的百度
&
转义成 %26
大家讲道理2017-04-10 13:11:28
不用一条道跑到黑的。一个实现不行就换个实现嘛 -w-
比如:http://phpqrcode.sourceforge.net/
就是不知道你的应用场合。不过PHP的库我想适用于大多数配置低至虚拟主机的网站主使用。