PHP中的echo語句用于輸出一個或多個字符串。以下是一些常見的echo用法:
echo "Hello World!";
echo "Hello", " World!";
$name = "John";
echo "My name is " . $name;
echo "<h1>Welcome</h1>";
$name = "John";
echo "My name is $name";
echo "This is a \"quote\"";
echo "Line 1\nLine 2";
echo "<h1>Welcome</h1>";
這些只是一些常見的用法,echo還有其他一些高級用法,如輸出數組、對象等。