Posts

Showing posts with the label PHP

PHP - The if Statement

Image
PHP - The if Statement The if statement executes some code if one condition is true. Syntax if (condition) {     code to be executed if condition is true; } Example: <!DOCTYPE html> <html> <body> <?php $t = date("H"); if ($t < "20") {     echo "Have a wonderful day!"; } ?> </body> </html>

PHP Conditional Statements by YAAK Developers

Image
PHP Conditional Statements by YAAK Developers Very often when you write code, you want to perform different actions for different conditions. You can use conditional statements in your code to do this. In PHP we have the following conditional statements: -if statement - executes some code if one condition is true -if...else statement - executes some code if a condition is true and another code if that condition is false -if...elseif....else statement - executes different codes for more than two conditions -switch statement - selects one of many blocks of code to be executed

Creating and Declaring PHP Variables

Image
Creating and Declaring PHP Variables <!DOCTYPE html> <html> <body> <?php $Z = "Hello YAAK!"; $a = 10; $b = 16.6; echo $Z; echo "<br>"; echo $a; echo "<br>"; echo $b; ?> </body> </html>

About PHP by YAAK Developers

Image
What is a PHP File? - PHP files can contain text, HTML, CSS, JavaScript, and PHP code. - PHP code are executed on the server, and the result is returned to the browser as plain HTML. - PHP files have extension ".php". What Can PHP Do? - PHP can generate dynamic page content. - PHP can create, open, read, write, delete, and close files on the server. - PHP can collect form data. - PHP can send and receive cookies. - PHP can add, delete, modify data in your database. - PHP can be used to control user-access. - PHP can encrypt data.