Information functions

When scripts for server maintenance or, for example, analyzing the file system, it is necessary to obtain information about a particular file. PHP offers a whole set of functions that…

READ MORE

file Locking

It can lead to a situation in which two or more people at a time will come to the site or just run the script. If it is, for example,…

READ MORE

Crop your files

PHP includes a function for reducing the file size to the desired size. The ftruncate (int index, int size) is just such a thing. Keep in mind that any data…

READ MORE

Write to File

The data file can be saved with fputs (int pointer, string string, int length). As with most of the functions that operate on files, it is necessary to specify the…

READ MORE

Reading from files

Reading from a file can be carried out in 2 ways one is a „low-level” reading data from a file using fread (int index, int length). It reads the data…

READ MORE

The internal file pointer

The internal file pointer, means the place in the file indicating the current location ‚- ie the place in which would start the writing or reading. Most of the functions…

READ MORE

Opening and closing files

All functions use the file as a parameter called charge. „Pointer to the file.” It is a variable that specifies the file open. This is necessary because the script can…

READ MORE

Replaces portions of strings

For substitution of entire passages used during the function str_replace (), which takes three parameters: the string to be swapped, a sequence which is to be swapped and a string…

READ MORE

Pulling pieces of string

Very often there is a need to draw from the variable text only a portion thereof. The easiest way is if you know the length of the exhaust passage and…

READ MORE