What does fputs mean in php
Editor to share with you what fputs means in php, I believe most people do not know much about it, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to know it!
In php, fputs is a function used to write to a file, while the fputs function is an alias for the fwrite function, which uses the syntax "fputs (file,string,length)", and the parameter file specifies the open file to write.
This article operating environment: Windows7 system, PHP7.4 version, Dell G3 computer.
What does fputs mean in php?
The fputs () function writes to a file (which can be safely used for binary files).
The fputs () function is an alias for the fwrite () function.
Grammar
Fputs (file,string,length)
Parameters.
File is required. Specifies the open file to write to.
String is required. Specifies the string to write to the file.
Length is optional. Specifies the maximum number of bytes to write.
Description
Fwrite () writes the contents of the string to the file pointer file. If length is specified, writing stops when length bytes are written or string is written, depending on which case is encountered first.
Fwrite () returns the number of characters written, or false when an error occurs.
Examples
Output:
21 above are all the contents of this article "what does fputs mean in php"? thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!