Hello friends how are you? Today in this blog we will learn two basic elements of PHP in which first is Syntax of PHP and another is First program in PHP. First i am going to explain the syntax of PHP in which i will include every single element which is used to create PHP program.
<?php //php code ?>
1.PHP starts with <?php and ends with ?> .
2.PHP code can be written anywhere in the php file.
3.The extension of PHP file is .php.
4.PHP file contains HTML,CSS,JAVASCRIPT,text and PHP code.
👉Hello World Program in PHP using echo
<?php echo "Hello World"; ?>
1.echo is used to display the text on to the output screen.
2.It can be used with parentheses or without parentheses.
<?php echo "Hello World<br>"; echo ("Hello World<br>"); ?> /* #output Hello World Hello World */
3.It can also print multiple string separated by comma simultaneously.
<?php echo "Hello ","friends "; ?> /* #output Hello friends */
4.It does not return any value.
5.echo is not case sensitive.
<?php echo "Hello World<br>"; ECHO "Hello World<br>"; Echo "Hello World"; ?> /* #output Hello World Hello World Hello World */
👉Syntax of PHP
<?php echo "Hello World"; ?>
1.echo is used to display the text on to the output screen.
2.It can be used with parentheses or without parentheses.
3.It can also print multiple string separated by comma simultaneously.
4.It does not return any value.
5.echo is not case sensitive.
Request:-If you found this post helpful then let me know by your comment and share it with your friend.
0 Comments