![]() |
Bold Text is used in web applications to highlight important information or headings. In this article, we will learn to bold text in PHP using two possible approaches with implementation. Below are the approaches to bold text in PHP: Table of Content Using the <b> tag from HTMLIn this approach, we are using the <b> tag from HTML directly within PHP’s echo statement to render text in bold. The text wrapped within <b> tags is styled as bold, as shown in the example where “Hello GFG! I am Bold Text in PHP” is displayed in bold. Example: The below example uses <b> tag from HTML to bold text in PHP.
Output: Using Inline CSSIn this approach, we are using inline CSS within PHP‘s echo statement to apply the font-weight: bold; style to a <span> element, resulting in bold text. The text “Hello GFG! I am Bold Text in PHP” is rendered in bold due to the inline CSS styling applied to the <span> element. Example: The below example uses Inline CSS to bold text in PHP.
Output: |
Reffered: https://www.geeksforgeeks.org
PHP |
Type: | Geek |
Category: | Coding |
Sub Category: | Tutorial |
Uploaded by: | Admin |
Views: | 14 |