PHP Syntax
The default file extension of php is ".php". The php syntax are described and listed below:
How to Start PHP?
PHP code start is start with "<?php" and end with "?>". Flow the example below-
<?php
// Inset or type the php code here as you know'
PHP and HTML
Generally php contain html tag. Without html tag we are unable to enhance php result.
Example of Code:
<html>
<html>
<body>
<h1> This is the header using HTML tag</>
<?php
// The code of php
?>
</body>
</html>
Comments Syntax
All programming have their own comments syntax. In php comments syntax is executable program. The comment syntax start with "//" or "#" but there is no end tag for single line comments. Double line comments start with "/*" and end wiht "*/"
Example of Code:
<html>
<body>
<?php
// This is the comments systex of php
# This is the comments systex of php
/* This is the multiple line comments. You can input as many word as you want. so dont hesitat to explain here. */
# This is the comments systex of php
/* This is the multiple line comments. You can input as many word as you want. so dont hesitat to explain here. */
echo 'The above codes are not executable in php programming';
?>
</body>
</html>
Case Sensitivity Syntax
In php script case sensitivity is not a factor for the keywords like "if", "while", "loop" etc. we can write both uppercase and lowercase.
Example of Code:
<html>
<body>
<?php
eCho 'The above code is not execugtable in php programming <br>';
ecHo 'The above code is not execugtable in php programming <br>';
ECHO 'The above code is not execugtable in php programming <br>';
echo 'The above code is not execugtable in php programming <br>';
?>
Example of Code:
<html>
<body>
<?php
eCho 'The above code is not execugtable in php programming <br>';
ecHo 'The above code is not execugtable in php programming <br>';
ECHO 'The above code is not execugtable in php programming <br>';
echo 'The above code is not execugtable in php programming <br>';
?>
PHP Variables Syntax
Php language have variables. which is used in coding. The variable start wih "$" here. The variables are container. If you use text variables than double quotes the value. e.g. "Hello Worlds". Variable is nothing but a name. A variable must start with a letter. It can not start with number. Variable name are case sensitive. E.g. "$Mashiur" and "$mashiur" are two different variable.
Example of Code:
<?php
$mashiur_says = "Hello How are You";
$shorif_says = "I am fine";
$varia_sum = 5;
$variable_fraction = 2505;
?>
By Autogarment.com
Example of Code:
<?php
$mashiur_says = "Hello How are You";
$shorif_says = "I am fine";
$varia_sum = 5;
$variable_fraction = 2505;
?>
By Autogarment.com
Garmentspedia Says What is he difference between " and ' in php script. E.g. echo 'The above code is not execugtable in php programming
ReplyDelete'; and echo "The above code is not execugtable in php programming
";. Both are showing same result.
" and ' are same
ReplyDelete