php读取txt随机一行一个数据输出,代码如下
<?php function getline($file){ $i=0; do{ $data = file($file); $num = count($data); $id = mt_rand(0,$num-1); $shuju_text = chop($data[$id]); $i=strlen($shuju_text); } while ($i<1); echo $shuju_text; } $file="link.txt"; getline($file); ?>标签:输出,php,读取,一行,随机,txt From: https://www.cnblogs.com/68xi/p/17764004.html