如何使用 php 中的 echo 在同一行中显示粗体和简单文本?
phpserver side programmingprogramming
为了获得粗体文本,您需要使用 font-weight,而要获得简单文本,您可以使用 <span> 标签。所有这些都添加到 echo 中。
示例
PHP 代码如下
<!DOCTYPE html> <html> <body> <?php echo '<span style="font-size: 20px; color: #006400; font-weight: bold;">This is my first PHP Program</span> '.$row['data']; ?> </body> </html>
输出
这是示例输出的快照。
This is my first PHP Program