代码示例:(标识:demo_php_echo2)
<!DOCTYPE html>
<html>
<body>

<?php
$txt1="Learn PHP";
$txt2="sou-xun.com";
$cars=array("Volvo","BMW","SAAB");
echo $txt1;
echo "<br>";
echo "Study PHP at $txt2";
echo "<br>";
echo "My car is a {$cars[0]}";
?>

</body>
</html>
运行结果: