![]() |
PHP Syntax |
PHP Syntax
A PHP script is executed on the server and the plain HTML, result is sent back to the browser.
Basic syntax
A PHP script can be placed anywhere in the document.
A PHP script start with <?php and end with ?> :
<?php
// PHP code goes here......
?>
The default file extension is " .php "
A PHP file normally contains HTML Tags and some php code scripting.
Below, we have an example of simple PHP file , with a PHP script that uses a built in php function " echo " to output the text " Hello World " on a web page.
Example
<!DOCTYPE html>
<html>
<head>
<title> PHP syntax with echo </title>
</head>
<body>
<h1> PHP syntax With First PHP code </h1>
<?php
echo "Hello MR. Kumar Atul Jaiswal.";
?>
</body>
</html>
Result
Hello MR. Kumar Atul Jaiswal.
NOTE :- PHP statement end with a semicolon ( ; ).
------------------------------------------------------------------------------------------------------------
- Also Read This Topic
- PHP 7 Why should you learn HP :- Click Here
![]() |
- PHP installation :- Click Here
-----------------------------------------------------------------------------------------------------------
Video On This Topic :- SooN
Have a Nice Stay Here : - )
0 comments:
Post a Comment
For Any Tech Updates, Hacking News, Internet, Computer, Technology and related to IT Field Articles Follow Our Blog.