Using Text-File Databases in PHP
Storing your data in a text file doesn't require any additional database software to be installed, but that's pretty much its only advantage. Its main disadvantages are clumsiness
Read tutorialTHE TUTORIAL LIBRARY
Storing your data in a text file doesn't require any additional database software to be installed, but that's pretty much its only advantage. Its main disadvantages are clumsiness
Read tutorialFTP stands for File Transfer Protocol and is a method of exchanging files between one computer and another. Unlike with HTTP servers, it's easy to set up an FTP server to both send
Read tutorialThe unzip.php sample program below, extracts files from a ZIP archive. It uses the pc_mkdir_parents() function. The program also requires PHP's zip extension to be installed. You c
Read tutorialThe zlib extension contains versions of many file-access functions, such as fopen(), fread(), and fwrite() (called gzopen(), gzread(), gzwrite(), etc.) that transparently compress
Read tutorialThe function parse_ini_file() reads configuration files structured like PHP's main php.ini file. Instead of applying the settings in the configuration file to PHP's configuration,
Read tutorialProcessing every word proceeds differently depending on how "word" is defined. The code in this recipe uses the Perl-compatible regular-expression engine's \s whitespace metacharac
Read tutorialYou want to count the number of lines, paragraphs, or records in a file.To count lines, use fgets(). Because it reads a line at a time, you can count the number of times it's calle
Read tutorialYou want to load the entire contents of a file into a variable. For example, you want to determine if the text in a file matches a regular expression. Use filesize()to get the size
Read tutorialWhen fopen() is passed a filename that begins with http://, it retrieves the given page with an HTTP/1.0 GET request (although a Host: header is also passed along to deal with virt
Read tutorialThe first argument to fopen()is the file to open; the second argument is the mode to open the file in. The mode specifies what operations can be performed on the file (reading and/
Read tutorialWhen embedded in a web server, PHP scripts usually do their job quickly and exit. This paradigm does not fit when using CLI; your scripts may run forever, or at least until the nex
Read tutorialpreg_split() can be used to split a string into substrings by using a regular expression match for the delimiters. PHP provides an explode() function that also splits strings, but
Read tutorialOne example today. A better developer tomorrow.