PHP Code to print text using echo command

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


echo(string ...$expressions): void

Source Code with Output to print text on webpage

/*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";


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

PHP Basic Programs »

Comments and Discussions!

Copyright © 2023 All rights reserved.