Echoing a String
<html>
<head>
<title>Echo Example</title>
</head>
<body>
<?php
$string1 = "A.<br />\n";
$string2 = "B ";
$string3 = "Line 1
spans multiple lines.
Line3<br />";
echo "Start, ", $string2, $string1;
echo("$string2$string1");
echo("This string $string1");
echo($string2 . $string1);
echo($string3);
echo "Line 1.
lin 2!!<br />";
?>
<?=$string2,$string1?>
<?="output", " java2s.com!", "<br />", ":-)", "<br />\n" ?>
<?="This string
spans multiple lines.
Even the newlines are output in the document source!<br />"?>
</body>
</html>
Related examples in the same category