Removing Duplicate Elements from an Array in PHP
Once processing is completed, array_unique()is the best way to eliminate duplicates. But, if you're inside a loop, you can eliminate the duplicate entries from appearing by checkin
Read tutorialTHE TUTORIAL LIBRARY
Once processing is completed, array_unique()is the best way to eliminate duplicates. But, if you're inside a loop, you can eliminate the duplicate entries from appearing by checkin
Read tutorialThe sort() function doesn't preserve the key/value association between elements; instead, entries are reindexed starting at 0 and going upward. (The one exception to this rule is a
Read tutorialWith foreach, PHP iterates over a copy of the array instead of the actual array. In contrast, when using each() and for, PHP iterates over the original array. So, if you modify the
Read tutorialWhen a browser sees a 401 header, it pops up a dialog box for a username and password. Those authentication credentials (the username and password), if accepted by the server, are
Read tutorialIt's a good idea to make the expiration time a few hours or an entire day in the past, in case your server and the user's computer have unsynchronized clocks. For example, if your
Read tutorialA cookie's value isn't available in $_COOKIE during the request in which the cookie is set. In other words, the setcookie() function doesn't alter the value of $_COOKIE. On subsequ
Read tutorialYou can pass additional arguments to setcookie() to control cookie behavior. The third argument to setcookie() is an expiration time, expressed as an epoch timestamp. For example,
Read tutorialThe mcrypt extension is an interface with mcrypt, a library that implements many different encryption algorithms. The data is encrypted and decrypted by mcrypt_encrypt()and mcrypt_
Read tutorialPHP can support a few different kinds of DBM backends: GDBM, NDBM, DB2, DB3, DBM, and CDB. The DBA abstraction layer lets you use the same functions on any DBM backend. All these b
Read tutorialStoring 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 tutorialOne example today. A better developer tomorrow.