How to create a text file in PHP?



How to create a text file in PHP?..

Answer / Vibhav Kumar Gaurav

To create a text file in PHP, you can use the `fopen()`, `fwrite()`, and `fclose()` functions:n- `$fp = fopen('filename.txt', 'w')` to open the file for writing.n- `fwrite($fp, $content)` to write content to the file.n- `fclose($fp)` to close the file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More PHP Interview Questions

i want the different aptitude questions on interview way

2 Answers  


Why does php need server?

1 Answers  


How to check an key is exists in array?

1 Answers  


What are php variables?

1 Answers  


How do you put a space in html?

1 Answers  


at present am learning lamp course sir ..i want to know the carrer prospectus in php ...is there any companies recruiting freshers in chennai ..for freshers how much can i demand as a fresher in php ....?i finished my mca ..please sugggest me to face interview in php asking salary details and all please suggest me how much can i ask as a fresher in php ? and also tel is there any openings in chennai for recruting php freshers send their emails and company info please ? please send ur valuable suggestions to kiranpulsar2007@gmail.com i hope u wil reply to my question thank u guys bye take care see u soon all the best to everyone

1 Answers   Microsoft, Satyam,


Tell us how can we access the data sent through the url with the post method?

1 Answers  


How do you clear environment variables?

1 Answers  


what is interface in java.

4 Answers  


How can we submit a form without a submit button?

4 Answers   Agile Software,


What is string and its function?

1 Answers  


What is properties of class?

1 Answers  


Categories