PHP使用单个fscanf从多行读取?

According to PHP documentation

mixed fscanf ( resource $handle , string $format [, mixed &$... ] )

Each call to fscanf() reads one line from the file.

Now I am trying to read this output from a file using single fscanf()

These are line separated inputs.

8

4.0

is the best place to learn

using this code

fscanf("%d 
 %f 
 %[^\
]");

but the output I am getting is

8

blank

blank

What is the correct code for it to read using single fscanf?

It is not possible to read multiple lines from a file with a single fscanf. An alternative is to call fscanf multiple times, one for each line. An alternative which will read all the lines in one go is the file() function.