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

PHP while loop The while is a control flow statement that allows code to be executed repeatedly based on a given boolean condition. This is the general form of the while loop: while (expression): statement The while loop executes the statement when the expression is evaluated to true. The statement is a simple statement terminated byContinue Reading

Code execution can be grouped into categories as shown below Sequential – this one involves executing all the codes in the order in which they have been written. Decision – this one involves making a choice given a number of options. The code executed depends on the value of the condition. AContinue Reading

Operator in PHP is a symbol that is used to perform operations.For example: +, -, *, / etc. There are many types of operators in PHP which are given below: Arithmetic operators Assignment operators Comparison operators Increment/Decrement operators Logical operators String operators Array operators Arithmetic operators Operator Description Example Result + AdditionContinue Reading

Strings are very important data types in computer languages. That is why we dedicate a whole chapter to working with strings in PHP. PHP string literal A string literal is the notation for representing a string value within the text of a computer program. In PHP, strings can be created with singleContinue Reading

List of PHP data types PHP has eight data types: Scalar Types boolean integer float string Compound Types array object Special Types resources NULL Unlike in languages like Java, C, or Visual Basic, in PHP we do not provide an explicit type definition for a variable. A variable’s type isContinue Reading