Spe*_*May 0 php text loops file-get-contents
我在php循环中读取文本文件时遇到问题.这是我的代码的一个更简单的例子,我知道我应该检查它是否存在我的较长版本中存在的文件,但无论我做什么,这都不会读取我的文本文件.PHP警告说文本文件是空的,但它们不是.PHP正在写这个<br />.
for ($i=1; $i<=5; $i++)
{
$myFile = "$i.txt";
$readfile = file_get_contents($myfile);
echo "$readfile <br />";
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
215 次 |
| 最近记录: |