Home » PHP » PHP Examples

How to make text bold in PHP?

Making text bold in PHP: In this article, we are going to learn how to bold text in PHP programming language?
Submitted by Kongnyu Carine, on May 27, 2019

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.

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

Example:

In this example, we will learn how to bold a sentence, a word, a character and a paragraph in 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






Comments and Discussions

Ad: Are you a blogger? Join our Blogging forum.




Languages: » C » C++ » C++ STL » Java » Data Structure » C#.Net » Android » Kotlin » SQL
Web Technologies: » PHP » Python » JavaScript » CSS » Ajax » Node.js » Web programming/HTML
Solved programs: » C » C++ » DS » Java » C#
Aptitude que. & ans.: » C » C++ » Java » DBMS
Interview que. & ans.: » C » Embedded C » Java » SEO » HR
CS Subjects: » CS Basics » O.S. » Networks » DBMS » Embedded Systems » Cloud Computing
» Machine learning » CS Organizations » Linux » DOS
More: » Articles » Puzzles » News/Updates


© https://www.includehelp.com some rights reserved.