Echo coding differently in php

Echo coding differently in php

Echo is a great code in php and we use it to declare anything which is look like an html code. Besides, after finishing a function code we must use echo code to show the result. There are lots of systems to use the echo code. Now I will describe the right using system of echo code.

1. It’s a general system to show any text into php code.

<?php

echo “Tutorial How to is a website.”;

?>

 

2. When we use a string variable and want to shoe the variable result we must use the echo code like below.

<?php

$sample = “Tutorial How to is a website.”;

echo $sample;

?>

 

3. This is another important tip for you that how can you join two string variables? Maximum time we use first name and last name file in a form and we show it in a line.

<?php

$str1=”Junaed”;

$str2=”Rabby”;

echo $str1 . ” ” . $str2;

?>

 

4. We may use html code into the echo command to decorate the text properly. It’s an example of textarea.

 

<?php

echo ‘<textarea style=”color:#FF0000;” name=”message”>Please Enter</textarea>’;

?>

 

5. How to use echo code into html. Though there is present a php source of that echo element.

<?php

$sample = “Tutria how to”;

?>

<p>This is <?=$sample?> website.</p>

 

Here,

<?=$sample?> means <?php echo $sample?>

Leave a Reply