PHP First Program


See the below table to get the opening and closing tags of php

Opening Tag Closing Tag
<?php ?>
<? ?>
<script language=’php’> </script>

PHP echo

The echo statement insert text into a web page. It is the common statement in php. We can echo a statement using following types

  • Single Quotes
  • Double Quotes
  • Without Quotes
  • “here document” method

Sample 1

echo 'Hello World';	// Single Quotes
echo "Hello World";	// Double Quotes
echo 12345;			// Without Quotes
echo <<<END
Hellow World

Sample 2:

//method 1
echo "Hellow World";
//method 2
echo "Hellow World";

<script language='php'>
//method 3
echo "Hellow World";

Sample 3:

<?php echo "PHP With HTML!"; ?>
This entry was posted in PHP and tagged .

Leave a Reply

Your email address will not be published. Required fields are marked *