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()
|
||||
{
|
||||
$filename = ROOT . '/assets/data/data.dat';
|
||||
//随机一言文件路径
|
||||
if (file_exists($filename)) {
|
||||
$data = explode(PHP_EOL, file_get_contents($filename));
|
||||
// $result = str_replace(array(
|
||||
// "\r",
|
||||
// "\n",
|
||||
// "\r\n"
|
||||
// ), '', $data[array_rand($data)]);
|
||||
return $data[array_rand($data)];
|
||||
}
|
||||
$data = file($filename, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
|
||||
// 随机获取一行索引
|
||||
$result = $data[array_rand($data)];
|
||||
// 去除多余的换行符
|
||||
$result = str_replace(["\r", "\n", "\r\n"], '', $result);
|
||||
return $result;
|
||||
}
|
||||
function rearr($data, $arr)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user