how to do this ?
-
-
hi, you must open the file with fopen function and read the lines with fgets function.
fopen
Syntax:#include <stdio.h>
FILE *fopen( const char *fname, const char *mode );The fopen() function opens a file indicated by fname and returns a stream associated with that file. If there is an error, fopen() returns NULL. mode is used to determine how the file will be treated (i.e. for input, output, etc)
fgets
Syntax:#include <stdio.h>
char *fgets( char *str, int num, FILE *stream );The function fgets() reads up to num - 1 characters from the given file stream and dumps them into str. The string that fgets() produces is always NULL-terminated.
PHPfgets() will stop when it reaches the end of a line, in which case str will contain that newline character.
Otherwise, fgets() will stop when it reaches num - 1 characters or encounters the EOF character. fgets() returns str on success, and NULL on an error.
If the wanted line is in a fixed order (number of line) recall fgets till you have your string, or
search for something with other string functions.............