I am learning today how to open file, write it or read by using PHP. I made some code which is probably wrong since everything I learnd is mixed in my head.
There is the problem. I want to create a new file called text.txt . Then I want to write something in ti and finaly after reading in to display that file on the screen. How to do that?
$name = "text.txt";
$write = fopen($name, 'w') or die("Can't open file");
$open = fopen($name, 'r');
$data = "AAAAAAAAAAAAAAA";
$show = fwrite($write,$data);
$a = fgets($open);