我文件中的数字是 5X5:
13456
23789
14789
09678
45678
我正在尝试将其放入这种形式
array[0]{13456}
array[1]{23789}
array[2]{14789}
array[3]{09678}
array[4]{45678}
我的代码是:
$fileName = $_FILES['file']['tmp_name'];
//Throw an error message if the file could not be open
$file = fopen($fileName,"r") or exit("Unable to open file!");
while ($line = fgets($file)) {
$digits .= trim($line);
$members = explode("\n", str_replace(array("\r\n","\n\r","\r"),"\n",$digits));
echo $members;
我得到的输出是这样的:
ArrayArrayArrayArrayArray
精慕HU
海绵宝宝撒
白衣非少年