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

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

If there is an input then it must have an output. So in PHP also there is two statements which are used for displaying output data to the screen echo print Both the statement are used for displaying data on the screen. Difference between ‘echo’ and ‘print’ echo print ThisContinue Reading