Tuesday, 15 October 2013

Echo Statement in php

Echo Statement in php

Echo Statement php programming Languages. This is a tutorialabout Echo Statement. Echo Statement is not function. In php the two basic constructs to get output are echo and print. print statement will see in next tutorial. Echo is language constructs within php that allows us to output data string to the user browser. Its allows us to output basically on the screen.
Echo Statement code (screenshot3) :-
Echo Statement in php
Echo Statement (Screenshot3)
1
2
3
<?php
echo 'Hello world';
?>
Output (screenshot4):-
In screenshot 3 is the example for how we can use echo statementand the output screenshot4. Now we can also use html tags in phpfor example
Echo Statement in php
Echo Statement (Screenshot4)
In example of code we had echo statement after echo we can usesingle quotation mark(‘) or double quotation mark(”) and you will learn about this when, why and where you should use quotation marks. Basically Double quotation mark allows you to output variables inside program before that you should know what are variables are. But this tutorial is about echo i am not going in so detail later on this will explain in detail. and semi colon (;) is used to end of the line in echo statement and also separator for two echo statements used one by another otherwise we can get some errorsfor example see screenshot1 and screenshot2.
Echo Statement in php
Echo Statement (Screenshot1)
Echo Statement in php
Echo Statement (Screenshot2)
html tags in php code (screenshot 5) :-
Echo Statement in php
Echo Statement (Screenshot5)
1
2
3
<?php
echo "<strong>Hello world.</strong>";
?>
output screenshot 6:-
Echo Statement in php
Echo Statement (Screenshot6)
In this example you had idea how we can use html tags in php. And also Echo statement uses for echoing output to the browser.
Read More Extra Tutorials

No comments:

Post a Comment