php, js - 微信号和二维码轮播 前端资源


一.php版:

$wechat = explode(",",$r['wechat']);//var_dump($wechat);
$wechat_rand = array_rand($wechat,1); //print_r($wechat_rand);
$wx = $wechat[$wechat_rand]; //print_r($wx);
随机微信号: &nbsp;<?php echo $wx; ?>&nbsp;


二. js版:

<script type="text/javascript">
arr_wx=['ndyf566','tywf1359'];
var wx_index = Math.floor((Math.random()*arr_wx.length));
var stxlwx = arr_wx[wx_index];
var img = arr_wx[wx_index]+".jpg";
var wx_img = "<img width='92%'  src='index_files/"+img+"'>";
</script>
随机微信号:<script> document.write(stxlwx);</script>
对应的二维码:<script> document.write(wx_img );</script>


签名:这个人很懒,什么也没有留下!
最新回复 (0)
返回