txt文本变为粗体_如何在PHP中使文本变为粗体?

txt文本变为粗体

Sometimes we might want to display text with style. That it's font, color, make it bold, italic, underlined and many more. Adding whatever style is all based on the message that we want to pass across or getting someone's attention.

有时我们可能想要显示带有样式的文本。 它是字体,颜色, 使其变为粗体 ,斜体,下划线等。 添加任何样式都是基于我们想要传递的信息或引起某人注意的信息。

In this article, we will learn how to bold text in PHP? When we bold text we make the text stand out than another. We can bold a single word, a phrase, a sentence, a particular paragraph or a letter.

在本文中,我们将学习如何在PHP中加粗文本? 当我们加粗文本时,我们使文本脱颖而出。 我们可以将单个单词 ,短语,句子,特定段落或字母加粗

We use the html tag <b>...</b> to bold text inside the PHP scripts.

我们使用html标签<b> ... </ b> 在PHP脚本中将文本加粗

Example:

例:

In this example, we will learn how to bold a sentence, a word, a character and a paragraph in PHP?

在此示例中,我们将学习如何在PHP中将句子,单词,字符和段落加粗?

PHP代码使文本变为粗体 (PHP code to make text bold)

<?php
    //this is a bold sentence
    echo "<b> this is a bold sentence</b>";
    
    //this is a bold word
    echo "<br> this is a bold word<b> john</b>";
    
    //this is a bold character
    echo "<br>this is a bold character<b> A</b>";
    
    //this is a bold paragraph
    echo "<br> this is a bold paragraph<b> 
    Lorem ipsum dolor sit amet, consectetur adipiscing elit,<br> 
    sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.<br> 
    Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris 
    nisi ut aliquip ex <br>
    ea commodo consequat. Duis aute irure dolor in </b>";
?>

Output

输出量

this is a bold sentence
this is a bold word john
this is a bold character A
this is a bold paragraph Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 
ea commodo consequat. Duis aute irure dolor in


翻译自: https://www.includehelp.com/php/how-to-make-text-bold.aspx

txt文本变为粗体

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值