Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What does fputs mean in php

2025-01-25 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/02 Report--

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!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 280

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report