PHP Coding Syntax



PHP is a scripting language that is used in back end. PHP is written inside html usually. PHP generally controls html, javascript and also syntax by using several condition or logic. For writing php code it is need to use php syntax where mainly php code is written. At first inside php file it is needed to use <?php  ?> . PHP starts with <?php and ends with ?>. Inside this php code will be written like below. Sometime people don't use ending tag(?>) during writing php code. This is almost not a good practice of coding. If any errors is happened than we will see it in browser. Php has a good feature to find out the error in exact line.


<?php
    
    echo "Hello PHP. I am starting journey with you";

?>

Here inside php block code is mainly situated. Inside this any kind of program like logic, loop, array , class , inheritance can be available. We are going to discuss about all the topics in upcoming post. You can write php code in any place of inside html. Html allows php to control it. For this reason , nowadays it becomes easy to code and run.


<!DOCTYPE html>
<html>
    <head>
        <title>PHP Starting Journey</title>
    </head>
<body>
    <?php
    
        echo "Hello PHP. I am starting journey with you";

    ?>

</body>
</html>