php tutorial - PHP Syntax - php programming - learn php - php code - php script



  • Now a days PHP is used for web development in order to create dynamic content that interacts with databases.
  • PHP is a highly securable language it is mostly used in software development in a web based application.

php scripts Syntax :

<?php
    content…………
?>
click below button to copy the code. php tutorial - team

  • Generally the PHP starts with “<?php “ and end with “?> statement.
  • The PHP basic depends on the “HTML” document whereas only scripting & functions are defined using “PHP”.
  • In general, we can define the php script anywhere inside the HTML document.


Sample Code in php : sample php program

<!DOCTYPE>
<html>
    <body>
        <?php
            echo "<h2>Welcome to Wikitechy PHP Tutorial Point!...</h2>";
        ?>
    </body>
</html>
click below button to copy the code. php tutorial - team

php programmer Code Explanation :

Code Explanation for Syntax In PHP

  1. In this Example The “PHP” script is Started with “<?php” .
  2. And Ended with question mark with closing angular bracket ” ?>”.
  3. In between that section we have to give the content for example in this program echo command is used for displaying the content in the browser so we are defining the <h2> heading element in this section and the echo command is started with double quotes (“ ”) and end with semicolon ( ; ) .

php development Sample Output :

output for Syntax In PHP

  1. Here in this output the statement “Welcome to Wikitechy PHP Tutorial Point!...” has been declared in h2 element so text will be displayed as Bold in large font as shown above.

PHP Comments

  • In PHP, we use // to make a single-line comment or /* and */ to make a large comment block.
  • php - php 7 - php tutorial - php framework tutorial - php examples - php sample code - php basics - php web development - php components - php project - php technology  - learn php - php online - php programming - php program - php code - html code - php comments

    Related Searches to php syntax