Home > Backend Development > PHP Tutorial > PHP text operation method collection comparison page 1/2_PHP tutorial

PHP text operation method collection comparison page 1/2_PHP tutorial

WBOY
Release: 2016-07-21 15:51:05
Original
1165 people have browsed it

String reading and writing functions fgets and fputs

1. Reading string function The function of fgets function is to read a string from the specified file into a character array. The function call is in the form: fgets (character array name , n, file pointer); where n is a positive integer. Indicates that the string read from the file does not exceed n-1 characters. Add the end-of-string mark ' after the last character readLine 16 of the program opens the binary file "stu_list" in read-write mode. After inputting two student data, it is written into the file. Then the internal position pointer of the file is moved to the beginning of the file. After reading out the two * blocks, it is displayed on the screen. show.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/319242.htmlTechArticleString reading and writing functions fgets and fputs 1. Reading string function The function of fgets function is to read from the specified file Read a string into a character array. The function call is in the form: fgets(number of characters...
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template