home

Php Output Data Tutorial


In php language we can output data by using a PHP Language Construct known as echo. Construct are elements that are built into language. echo can be used for outputting any data. It can also be used to output HTML

Example of PHP echo


<?php

echo "this is my echo message"; 

?>

The above example will show this message on webpage. this is my echo message.

Another Example of PHP echo


<?php

echo "this is my echo message";

echo "<BR>";

echo "this is my second line with echo command";

echo "<BR>";

echo "<B>this is a bold message by using php echo</B>";

?>

 

PHP Print ()

echo is a construct, but a function called print() can also be used to echo data.



<?php

print(30);//this will output 30

?>

 

PHP Hello, World Example

Here is the PHP equivalent of the class "Hello, World" programming example:


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN">
<html>
<head>
<title>Hello World in PHP</title>
</head>

<body>

<?php echo "<h1>Hello, World!</h1>"; ?>

</body>
</html>


The above script will generate an HTML document with a Heading one "Hello, World!"


Content on this page requires a newer version of Adobe Flash Player.

Get Adobe Flash player

all rights reseverd by Cramerz.com©. web design london by dotPeak. hosting by HostBay
all contents on cramerz are the property of Cramerz.com