English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
PHP Filesystem Reference Manual
The fputs() function can write to an open file. This function can stop at the end of the file or at the specified length (whichever comes first). It can return the number of bytes written on success, or FALSE on failure, and it is an alias for the fwrite() function.
fputs(file,string,length)
This function is binary safe, which means binary data (such as images and character data) can be written using this function.
<?php $file = fopen("sample.txt", "w"); echo fputs($file, "Hello w3codebox!!!!"); fclose($file); ?>
Output Result
24