fwrite example in php
The fwrite() is used to write the contents to text file.
// content will be written $fp pointer and it will be written in data.txt.
<?php $fp = fopen('data.txt', 'w'); fwrite($fp, '1'); fwrite($fp, '23'); fclose($fp); // the content of 'data.txt' is now 123 and not 23! ?>
// it will be written in the data.txt, which will be in the same location of php source file.
Thanks for reading this post……….!!!
329 total views, 1 views today