Regular expressions are used for text searching and more advanced text manipulation. Regular expressions are built-in tools like grep, sed, text editors like vi, emacs, programming languages like Tcl, Perl, and Python. PHP has a built-in support for regular expressions too. In PHP, there are two modules for regular expressions:Continue Reading

PHP has a number of functions for handling as well as reporting errors. Besides, you can define your own way of handling and reporting errors. In this and subsequent pages we are going to discuss installation, runtime configuration, predefined constants and functions relating to PHP error handling and reporting. ConfigurationContinue Reading

PHP session has the ability to store information on the server that can be accessed across multiple PHP pages. In PHP, There are three common methods to pass data from any page to other pages. The Session is one of them. The second method is using Cookies and the third method is PHP Form. However,Continue Reading

What is a Cookie Cookies are used to store the information of a web page in a remote browser, so that when the same user comes back to that page, that information can be retrieved from the browser itself. In this tutorial, we will discuss how to use Cookies inContinue Reading

File Inclusion The include (or require) statement takes all the text/code/markup that exists in the specified file and copies it into the file that uses the include statement.Including files is very useful when you want to include the same PHP, HTML, or text on multiple pages of a website. YouContinue Reading

We can easily upload files to the server using PHP & HTML Form. PHP has the ability to upload different kind of files. We can upload images, audios, videos, ZIP files, MS Office documents, PDFs and many others. We need to be careful when uploading file. We can check fileContinue Reading

PHP File Handling PHP File handling is an important part of any web application. You often need to open and process a file for different tasks. Opening a File Reading a File Writing a File Closing a File Delete a File Opening a File using fopen() Function A better method to openContinue Reading

What is Form? When you login into a website or into your mail box, you are interacting with a form. Forms are used to get input from the user and submit it to the web server for processing.  The diagram below illustrates the form handling process. A form is anContinue Reading

PHP sorting arrays First we are going to sort an arrays. sort.php <?php $names = [ “Jane”, “Rebecca”, “Lucy”, “Lenka”, “Ada” ]; echo “Unsorted: \n”; foreach ($names as $name) { echo “$name “; } echo “\n”; sort($names); echo “Sorted: \n”; foreach ($names as $name) { echo “$name “; } echoContinue Reading

What is a PHP Array? A PHP array is a variable that stores more than one piece of related data in a single variable. Think of an array as a box of chocolates with slots inside. The box represents the array itself while the spaces containing chocolates represent the valuesContinue Reading