PHP Echo

Previous Next PHP Print


PHP echo statement is used to get output ex: text output and variables output etc.

echo statement can be with echo or without paranthesis echo().

echo statements can be with single ' quotes or double"" quotes.

We trying to cover all possiblity of echo to learn better and deeply.

Following are the syntax of echo given below.

Syntax

echo ''

echo "";

echo $variables;

echo $variables=''

echo $variables="";

You can use all html tag inside quotes or paranthesis

PHP echo Statements in Single Quotes.

Filename: php / echo-s-quotes.php


Code
<?php
// echo single quotes statements
echo '

Hello PHP

'; echo 'Hello World
'; echo '

This is paragraph.

'; echo 'Some Text...'; echo 'Hello'.'Text'.'
'; echo '
'; ?>

Running Step.


Type Url - https://localhost/php/echo-s-quotes.php

PHP echo Statements in Double Quotes.

Filename: php / echo-d-quotes.php


Code
<?php
// echo double quotes statements
echo "

Hello PHP

"; echo "Hello World
"; echo "

This is paragraph.

"; echo "Some Text..."; echo "Hello"."Text"."
"; echo "
"; ?>

Running Step.


Type Url - https://localhost/php/echo-d-quotes.php


Tags: PHP


Was this helpful ?

Related Code


Popular Code

Latest Code