mirror of
https://github.com/LyLme/lylme_spage.git
synced 2024-11-17 14:34:08 +08:00
更新1.8.0版本
This commit is contained in:
parent
9eab67a909
commit
601accf7a7
@ -212,16 +212,12 @@ function get_real_ip()
|
|||||||
function yan()
|
function yan()
|
||||||
{
|
{
|
||||||
$filename = ROOT . '/assets/data/data.dat';
|
$filename = ROOT . '/assets/data/data.dat';
|
||||||
//随机一言文件路径
|
$data = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||||
if (file_exists($filename)) {
|
// 随机获取一行索引
|
||||||
$data = explode(PHP_EOL, file_get_contents($filename));
|
$result = $data[array_rand($data)];
|
||||||
// $result = str_replace(array(
|
// 去除多余的换行符
|
||||||
// "\r",
|
$result = str_replace(["\r", "\n", "\r\n"], '', $result);
|
||||||
// "\n",
|
return $result;
|
||||||
// "\r\n"
|
|
||||||
// ), '', $data[array_rand($data)]);
|
|
||||||
return $data[array_rand($data)];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
function rearr($data, $arr)
|
function rearr($data, $arr)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user