Monday 20 March 2017

echo statement in PHP

echo statement is used to display the text on the browser. or get output on browser.The echo statement can be used with or without parentheses: echo or echo().
You can pass text to display to the echo statement, using single or double quotes.
you can also directly pass the numbers to echo if you want , no. quotation marks needed.

For example:-

<html>
<head>
<title>Displaying text using echo statement</title>
</head>
<body><h1>Displaying text using echo</h1>
<br></br>
<?php
echo "first statement";
echo 'second statement';
?>
  </body>
</html>
browser view is:-

Displaying text using echo
first statement
second statement

No comments:

Post a Comment