PHP fscanf vs fgets
问题 I am able to read an entire string in a line using fgets() but fscanf() is not doing so. According to PHP manual fscanf — Parses input from a file according to a format The function fscanf() is similar to sscanf() , but it takes its input from a file associated with handle and interprets the input according to the specified format, which is described in the documentation for sprintf() . fgets — Gets line from file pointer Gets a line from file pointer. Since fscanf() supports formats as