How to write into a file in PHP

0 votes

I have this script on one free PHP-supporting server:

<html>
<body>

<?php
file = fopen("lidn.txt","a");


fclose(file);
?>

</body>
</html>

It creates the file lidn.txt, but it's empty.

How can I create a file and write something into it?

Jun 20 in PHP by Kithuzzz
• 320 points
4 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.

Related Questions In PHP

0 votes
1 answer

How to write CSV To File Without Enclosures In PHP?

Hello @kartik, The warnings about foregoing enclosures are ...READ MORE

answered Nov 9, 2020 in PHP by Niroj
• 82,720 points
1,555 views
0 votes
0 answers

How to open a file named index.php which is in htdocs/project1 folder in xampp?

I have a folder named project1 in ...READ MORE

May 29 in PHP by Kichu
• 19,040 points
19 views
0 votes
0 answers
0 votes
1 answer

How to implement a callback in PHP?

Hello, Implementation of a callback is done like ...READ MORE

answered Apr 15, 2020 in PHP by Niroj
• 82,720 points
224 views
0 votes
1 answer

How can I connect to a Tor hidden service using CURL in PHP?

Hello @kartik, I use Privoxy and cURL to scrape Tor ...READ MORE

answered May 19, 2020 in PHP by Niroj
• 82,720 points
2,966 views
0 votes
1 answer

How to concatenate text from multiple rows into a single text string in SQL server?

Hello @kartik, Use COALESCE: DECLARE @Names VARCHAR(8000) SELECT @Names = ...READ MORE

answered Jul 21, 2020 in PHP by Niroj
• 82,720 points
1,958 views
0 votes
1 answer

Move_uploaded_file() function is not working

The file will be stored in a ...READ MORE

answered Feb 22 in Others by Aditya
• 7,280 points
63 views
0 votes
0 answers

How to use Unlink() function

I tried using the PHP unlink() function to ...READ MORE

Jun 13 in PHP by narikkadan
• 10,840 points
5 views
0 votes
0 answers

Read a plain text file with php

How do I read all the information ...READ MORE

5 days ago in PHP by narikkadan
• 10,840 points
14 views
+1 vote
2 answers

Scp Php files into server using gradle

Tru something like this: plugins { id ...READ MORE

answered Oct 11, 2018 in DevOps & Agile by lina
• 8,220 points
526 views
webinar REGISTER FOR FREE WEBINAR X
Send OTP
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP