0% found this document useful (0 votes)
9 views2 pages

Quick Notes Page 1

Uploaded by

Yash Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views2 pages

Quick Notes Page 1

Uploaded by

Yash Patil
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

<!

DOCTYPE html>
<html lang="en">
Creating our first PHP file
<head>
Create a new file with the name index.php. Yes, this time, it is <meta charset="UTF-8">
<meta name="viewport"
PHP. To get the VSCode BoilerPlate Tap ! and then press enter. content="width=device-width, initial-scale=1.0">
Now create a div container in the body and type "This is my <title>PHP Tutorial</title>
</head>
first PHP website." All right, now go to your browser type <body>
localhost/cwh. You did it. Congratulations on creating your first <div class="container">
This is my first php website
PHP website.
</div>
</body>
</html>

<?php
To Print String Type Variables We Use "ECHO" function echo "Hello world and this is printed
echo is, it outputs one or more strings using PHP";
?>

 // Single line comment

 /*

Comments In Php  This


To take an comments In php we mainly take 2 types of
Comments'  is

1. Single line comment


 a
2. Multiple or Multiline comments
 multi

 line

 comment

 */

Variables are nothing more than a container for holding the


values in it. In PHP, you can create a variable by including the
$variable1 = 5;
“ $ “ before declaring it.
$variable2 = 2;
echo $variable1;
PHP is a dynamically typed language, meaning here, you don’t echo $variable2;
have to declare the data types. PHP is not case sensitive that
means classes, functions, and user-defined functions are not case
sensitive

Operators are used to performing operations on


variables. Operators are symbols that tell the PHP processor to
perform certain actions. For example, the addition (+) symbol is
an operator that tells PHP to add two variables or values, while
the greater-than (>) symbol is an operator that tells PHP to

Quick Notes Page 1


the greater-than (>) symbol is an operator that tells PHP to
compare two values.

PHP Arithmetic Operators

// Arithmetic Operators
Operator Description Example Result
+ Addition $x + $y Sum of $x and $y
- Subtraction $x - $y Difference of $x and $y.
echo "<br>";
* Multiplication $x * $y Product of $x and $y.
/ Division $x / $y Quotient of $x and $y

echo "The value of varible1 + variable2 is ";

echo $variable1 + $variable2;

echo "<br>";

echo "The value of varible1 - variable2 is ";

echo $variable1 - $variable2;

echo "<br>";

echo "The value of varible1 * variable2 is ";

echo $variable1 * $variable2;

echo "<br>";

echo "The value of varible1 / variable2 is ";

echo $variable1 / $variable2;

echo "<br>";

Quick Notes Page 2

You might also like