Wow! That was quick. Than you guys for your answers. You are awesome people. I know this sounds silly but I want to clarify that none of those functions mess with files on a local machine.
PHP is a languge used to perform programming in servers. So all the work you are doing there are based on servers. (Think you know what is a server and how servers work/behave). Any program you run with PHP doesn't work on the client's computer. Everything is done in the server.
So the final decision :
When you create and work with files, its all done in the server.
When you are working on your local machine, use xampp server. You will notice all of those concepts clearly. (in the htdocs folder (default))
Happy coding 🙂
You need to have a file eg a text file (file.txt) to work on using the methods.
Eg, when you have a text file in the same location where your php file is, you can use this syntax to open the file;
Then wrtting data to it, lets say we are getting values from a login page to be written to the file
fwrite ($handle, $variable);
fwrite ($handle, "=");
fwrite ($handle, $value);
fwrite ($handle, "\r\n"
fwrite ($handle, "\r\n");
But first you need a local server installed
I hope this helps
Happy coding 😊 Keep coding 🙏