Q:

PHP Code to print text using echo command

belongs to collection: PHP Basic Programs

0

In this PHP Code you will learn how to print string of string from variables on the webpage using echo command?

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

Source Code with Output to print text on webpage

<?php
/*print string*/
echo "Hello world\n";

/*print variable values*/
$text = "Sample text";
$lucky_number = 100;

echo "</br>";

echo "Value of text is: " . $text . " Lucky number is: " . $lucky_number . "\n";
?>

Output

Hello world
Value of text is: Sample text Lucky number is: 100 

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

PHP program to create a function to find the addit... >>
<< PHP Code to print text using print command...