Author Archives: Help_adm

PHP Date()

The PHP date() function is used to format a time or a date. The PHP Date() Function The PHP date() function formats a timestamp to a more readable date and time. Syntax date(format,timestamp) Parameter Description format Required. Specifies the format of the timestamp timestamp Optional. Specifies a timestamp. Default is the current date and time… Read More »

Category: PHP

PHP $_POST

The $_POST variable is used to collect values from a form with method=”post”. The $_POST Variable The $_POST variable is an array of variable names and values sent by the HTTP POST method. The $_POST variable is used to collect values from a form with method=”post”. Information sent from a form with the POST method… Read More »

Category: PHP

PHP $_GET

The $_GET variable is used to collect values from a form with method=”get”. The $_GET Variable The $_GET variable is an array of variable names and values sent by the HTTP GET method. The $_GET variable is used to collect values from a form with method=”get”. Information sent from a form with the GET method… Read More »

Category: PHP

PHP Forms and User Input

The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. PHP Form Handling The most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts. Form example: <html> <body> <form action=”welcome.php”… Read More »

Category: PHP

PHP Functions

The real power of PHP comes from its functions. In PHP – there are more than 700 built-in functions available. Create a PHP Function A function is a block of code that can be executed whenever we need it. Creating PHP functions: All functions start with the word “function()” Name the function – It should… Read More »

Category: PHP

PHP Looping

Looping statements in PHP are used to execute the same block of code a specified number of times. Looping Very often when you write code, you want the same block of code to run a number of times. You can use looping statements in your code to perform this. In PHP we have the following… Read More »

Category: PHP

PHP Arrays

An array can store one or more values in a single variable name. What is an array? When working with PHP, sooner or later, you might want to create many similar variables. Instead of having many similar variables, you can store the data as elements in an array. Each element in the array has its… Read More »

Category: PHP

PHP Switch Statement

The Switch statement in PHP is used to perform one of several different actions based on one of several different conditions. The Switch Statement If you want to select one of many blocks of code to be executed, use the Switch statement. The switch statement is used to avoid long blocks of if..elseif..else code. Syntax… Read More »

Category: PHP

PHP If…Else Statements

The if, elseif and else statements in PHP are used to perform different actions based on different conditions. Conditional Statements Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do this. if…else statement – use this statement if you want… Read More »

Category: PHP

PHP Operators

Operators are used to operate on values. PHP Operators This section lists the different operators used in PHP. Arithmetic Operators Operator Description Example Result + Addition x=2x+2 4 – Subtraction x=25-x 3 * Multiplication x=4x*5 20 / Division 15/55/2 32.5 % Modulus (division remainder) 5%210%810%2 120 ++ Increment x=5x++ x=6 — Decrement x=5x– x=4 Assignment… Read More »

Category: PHP