PHP foreach by value vs foreach by reference
When you use a foreach loop, PHP creates a copy of the current element you are using in your loop. Any changes you make to this element is not saved…
Simply Explaining Technology
When you use a foreach loop, PHP creates a copy of the current element you are using in your loop. Any changes you make to this element is not saved…
Converting strings to dates in PHP requires the use of two functions. strtotime function converts the string to an epoch timestamp. date function converts the timestamp to the desirable date…
PHP does not support explicit type definition in variable declaration. For example, you CANNOT declare a variable as follows: In PHP, a variable’s type is determined by the context in…
PECL is a repository for PHP Extensions. It provide a directory which contains numerous PHP extensions and hosting facilities where these extensions can be downloaded. Using PECL to install extensions:…
PHP provides four functions which enable you to insert code from other files. * include()* require()* include_once()* require_once() All four can take a local file or URL as input. None…
The following code encrypts a string. crypt() function encrypts the string. The last line prints the encrypted string. There is no such function called decrypt(). This is because crypt uses…
What is Unit Testing Most developers agree that testing is important but few test their code. Even fever do it methodically. Many developers do not realize that there is a…
phpDocumentor is a tool which creates complete documentation like Javadocs for PHP code. Installing phpDocumentor Install libraries. Restart Apache. Install PEAR. PEAR is a repository of php extensions: Tell PEAR…
Converting XML to JSON is very easy in PHP. See the following code. line 1: open an empty file to write JSON line 2: load xml file line 3: convert…
Oracle’s VirtualBox is a very solid and stable virtual machine but it isn’t the simplest to work with. So I abandoned it a week after I started working with. Recently,…