随机本地词典内容,随机一行文本输出
<?php
//获取句子文件的绝对路径
$file = file($yiyanPath."yiyan.txt");
//随机读取一行
$arr = mt_rand( 0, count( $file ) - 1 );
$content = trim($file[$arr]);
echo $content;
?>
随机本地词典内容,随机一行文本输出
<?php
//获取句子文件的绝对路径
$file = file($yiyanPath."yiyan.txt");
//随机读取一行
$arr = mt_rand( 0, count( $file ) - 1 );
$content = trim($file[$arr]);
echo $content;
?>