Syntax PHP

June 21 0 Comments Category: Uncategorized

php

Syntax

- The rules that must be followed to write properly structured code.

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. All PHP code must be contained within the following…



<?php

?>

or shorthand

<?

?>


If you are writing PHP scripts and plan on distributing them, we suggest that you use the standard form (which includes the ?php) rather than the shorthand form. This will ensure that your scripts will work, even when running on other servers with different settings.

Below is an example of one of the easiest PHP snippet that you can create which follows all web standards.

<html>
<head>
<title>Invincible Brain ‘s PHP GUIDE </title>
</head>
<body>
<?php
echo “Hey!I am exploring PHP WORLD”;
?>
</body>
</html>

Result

Hey!I am exploring PHP WORLD

Write a Comment

Commenter Gravatar