PHP Tutorial - Chapter 2 - PHP Syntax & Variables (Khmer Language)

This video learn about PHP basic as syntax and variables



1. PHP Syntax

<?php
// PHP code goes here
?>

2. PHP Variables

<?php
$txt = "Hello world!";
$x = 5;
$y = 10.5;
?>

3. PHP Examples

Example 1:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Untitled 1</title>
</head>

<body>
<?php
echo "Hello World!";
?>
</body>
</html>

Example 2:

<?php
$str = "Hello World!";
echo $str;
?>

Example 3:

<?php
$a = 10;
$b = 10.5;
$c = $a + $b;
echo "a = 10<br>";
echo "b = 10.5<br>";
echo "c=" . $c;
?>

Follow Us with Facebook
Follow Us with Community
Subscribe Our Channel


Share this

Related Posts

Previous
Next Post »