The key problem with file system operations is the precarious situation you are in if two scripts attempt to write to a file at the same time. The fopen() function, when called on a file, does not stop that same Continue reading PHP – Locking files with flock()
The above code, gives an example of the methods to use for extracting the contents of files, or status and size of files, in a .zip archive.
Suppose the application should reduce the list of percentages to those that are equal to or greater than a user-specified value. For this we can use array_filter(). The array_filter() function accepts an input array and the name of a function, Continue reading PHP – Anonymous Functions and Closures (Part II)
Anonymous functions are functions that are defined without being bound to a proper name. Typically, anonymous functions are used only a limited number of times and for a specific purpose; you could think of them as “throw-away” functions if you’d Continue reading PHP – Anonymous Functions and Closures (Part I)
Below code sample is for extracting the contents of a .zip file into a folder given by ‘/test/’. Note that if the folder ‘test’ is not there, it is created. The method extractTo does the process of reading all files Continue reading PHP – Extracting a zip compressed archive into a folder