$jieshaos=file(jieshaos.txt");//讀取文本文件jieshaos.txt內容存入函數$jieshao (此時為數組) $jieshaoc=count($jieshaos);// 獲取數組個數 $jieshaor=rand(1,$jieshaoc);//生成 1到數組個數最大值的數字 $jieshao=@$jieshaos[$jieshaor]; 獲取下標值 echo "$jieshao";
$jieshaos=file(jieshaos.txt");//讀取文本文件jieshaos.txt內容存入函數$jieshao (此時為數組) $jieshaoc=count($jieshaos);// 獲取數組個數 $jieshaor=rand(1,$jieshaoc);//生成 1到數組個數最大值的數字 $jieshao=@$jieshaos[$jieshaor]; 獲取下標值 echo "$jieshao";
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。