If you have already register Login here.
PHP's syntax and semantics are similar to most other programming languages (C, Java, Perl) with the addition that all PHP code is contained with a tag, of sorts.
There are three different pairs of opening and closing tags which can be used in php. Here is the list of tags.
This is the most commonly used (and recommended) form. It is known as the XML style because it can be used inside of an XML document without causing the document to become poorly formed.
This is the most commonly used (and recommended) form. It is known as the XML style because it can be used inside of an XML document without causing the document to become poorly formed.
Example:
<?php
echo "This Is Php default Syntax";
?>
It begin with (< ?php) and End with(? >).
echo statement is used to print the given string. Mandatory closing in (“Php default Syntax”) double-quotes.
Terminate the script with a semicolon because a semicolon is known as the terminator.
The short tags start with "". Short style tags are only available when they are enabled in the php.ini configuration file on servers.
Example:
<?
echo "This Is Php Short open Tags";
?>
We use Short tags. start and end with () respectively.
Declare the statement in between (), to display the output on browser
short open tags smoothly work on XAMPP server but Face problem on wamp server
if you are using WAMP Server First you have to Set the short_open_tag setting in your php.ini file to on
HTML script tags look like this :
<script language="PHP">
echo "welcome to the Easytolearning.com Using Html Script Tag";
</script>
Some editors like FrontPage editor have own problem to deal with escape situation and the said script is effective to solve it.
Below is an example of one of the easiest PHP and HTML pages that you can create and still follow web standards.
PHP and HTML Code:
<html>
<head>
<title>My First PHP Page</title>
</head>
<body>
<?php
echo "Hello World!";
?>
</body>
</html>
© 2025 Easy To Learning. All Rights Reserved | Design by Easy To Learning