php输出文言文句 一言接口定义
随机本地词典内容,随机一行文本输出
<?php
//获取句子文件的绝对路径
$file = file($yiyanPath."yiyan.txt");
//随机读取一行
$arr = mt_rand( 0, count( $file ) - 1 );
$content = trim($file[$arr]);
echo $content;
?>
本文来自博客园,作者:火知火味,转载请注明原文链接:https://www.cnblogs.com/whwa/p/17322132.html

浙公网安备 33010602011771号