<?php
$img_num = array("6","8","10","15","16","17","19","20","21","24","25","30");//一组数组
$fileath = $img_num[array_rand($img_num)];//随机获取该数组中一个值
echo $fileath;
?> 本文结束
<?php
$img_num = array("6","8","10","15","16","17","19","20","21","24","25","30");//一组数组
$fileath = $img_num[array_rand($img_num)];//随机获取该数组中一个值
echo $fileath;
?> 本文结束



标题:PHP从数组中随机获取其中的一个数值
链接:http://nidecms.com/web/3/aab3238922bcc25a6f606eb525ffdc56.html
时间:2023-10-01
版权:本文为博主原创文章,未经博主允许不得转载。
上一篇