Learn PHP from Scratch Day 3

Learn PHP from Scratch Day 3
Learn PHP from Scratch Day 3

PHP Data Types

PHP Variable

<?php
$k = 10;
echo $k;
?>
10
<?php
$pi = 3.14;
echo $pi;
?>
3.14
<?php
$my_text ="PHP is Server Side Script";
echo $my_text;
?>
PHP is Server Side Script

Use of Variables

Variable Type Casting

<?php
$a = 4;
$b = 1.5;
$c = $a + $b;
$c = $a + (int) $b;
echo $c;
?>
2
<?php
$a = 4;
var_dump($a);
$b = 1.5;
var_dump($b);
$c = "I am PHP";
var_dump($c);
$d = true;
var_dump($d);
?>
int(4) float(1.5) string(8) "I am PHP" bool(true)

PHP Constant

PHP Operators

Arithmetic operators

PHP Arithmetic Operators

Assignment Operators

PHP Assignment Operators

Comparison operators

PHP Comparison Operators

Logical operators

PHP Logical Operators

Summary

Blog categories