File Operations in PHP

I will talk about file operations in PHP( handling , read, write etc.). Lets take a look at reading file first.

As an example we have a file called test.txt and if we want to read the contents within the file, can simply do like this.

But what if we want to handle more than reading a file, we can use fopen

We can also get the first line in file using fgets

We can also use feof to check whether the file reaches to the end.

If we want to check whether file exists or not , we can do like this

By Yuuma.




tel. 06-6454-8833(平日 10:00~17:00)