Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个包含多行的文件,如下所示:
5 2 1 10 20 30
如何读取每一行并将值放入数组中?
我想必须$array1包含第一行$array2的值并包含第二行的值。
$array1
$array2
我试过这个没有太大成功:
define("STDIN", "php://stdin"); $fr = fopen(STDIN, "r"); fscanf($fr, "%d\n", $array);