Google News
logo
PHP Code to print text using print command
Here is an example of how to use the `print` command in PHP to print text to the screen :
Program :
<?php
	// This is a PHP program that uses the print command
	print "Hello, World!"; // Print the string "Hello, World!" to the screen
?>
Output :
Hello, World!
In this code, the `print` command is used to print the string "Hello, World!" to the screen. Note that the string is enclosed in double quotes, which is necessary to define it as a string literal.

The `print` command is a language construct in PHP that is used to output text to the screen. It can be used to print strings, numbers, and other data types to the screen.

It is similar to the `echo` command in PHP, but the `print` command has a return value of 1, whereas `echo` does not have a return value.