preg_match() is the function that matches one pattern with the subject string and returns either true or false depending whether the subject matched the pattern. It also can return
Read tutorial ↗In case you want to create a temporary file, the best way to do it is with the tmpfile() function. This function creates a temporary file with a unique random name in the current d
Read tutorial ↗PHP provides the unlink() function for deleting a file, which "unlinks" the file from a directory. On a UNIX-like system the file will only be deleted if no programs have this file
Read tutorial ↗While writing to files that are possibly being read by other scripts at the same time, you will run into problems at some point because a write might not totally be completed while
Read tutorial ↗Let's begin with the basic file-accessing functions. Originally, those functions only worked on normal files, so their names begin with "f," but PHP extends this to almost everythi
Read tutorial ↗The first line is the XML declaration; it specifies the XML version and the XML file encoding. Notice that the line starts with
Read tutorial ↗BLOB stands for Binary Large OBject and refers to binary data, such as JPEG images stored in the database.
Read tutorial ↗This article contains some information about the strengths and weaknesses of MySQL.
Read tutorial ↗A PHP session allows an application to store information for the current "session," which can be defined as one user being logged in to your application. A session is identified by
Read tutorial ↗One simple way to maintain data between the different pages in a web application is with cookies. Cookies are sent by PHP through the web server with the setcookie() function and a
Read tutorial ↗The Crypt_HMAC class implements the algorithm as described in RFC 2104 and can be installed with pear install crypt_hmac.
Read tutorial ↗If you need to prevent bad guys from tampering with variables passed in the URL (such as for a redirect as shown previously, or for links that pass special parameters to the linked
Read tutorial ↗