下列哪个函数可以将文本文档读取成为字符串
A: file_get_contents()
B: file_put_contents()
C: str_replace()
D: mb_strlen()
A: file_get_contents()
B: file_put_contents()
C: str_replace()
D: mb_strlen()
举一反三
- 要读取文件中的一个字符,应使用函数()。 A: fgets() B: fgetc() C: file_get_contents() D: file()
- 以下哪一个函数可以将文件内容读取出来,并逐行存入数组中。 A: file_get_contents B: file C: fgets D: fgetc
- 以下函数可以对文件进行读取的是( )。 A: fread() B: fgetc() C: file_get_contents() D: file_put_contents()
- 如何将字符串“Hello World”写入a.txt文件内?FILE *file; file = fopen("a.txt","w"); A: char str = "Hello World"; fputs(&str,file); B: char str = "Hello World"; fputc(&str,file); C: char str = "Hello World"; fput(&str,file); D: char str = "Hello World"; fputs(str,file);
- 标准库函数fgets(s,n,file)的功能是( )。 A: 从文件file中读取长度为n的字符串存入字符数组s中 B: 从文件file中读取长度不超过n-1个字符的字符串放到字符数组s中 C: 从文件file中读取n个字符串存入字符数组s中 D: 从文件file中读取长度为n-1个字符的字符串存入字符数组s中