How to Justify Text in PHP

PHP allows you to create dynamic pages, and you must include the dynamic layout with the PHP code. You can use the paragraph tag to justify the text on your PHP pages. You wrap the

tag around the text you want to justify, and the reader's browser formats the text.

Step

Right-click the PHP file you want to edit and select "Open With." Double-click your PHP editor in the list of editor software.

Step

Scroll down the page to the section of the PHP code where you want to justify the text.

Step

Type the following code around the output text to justify the format:

Step

echo "

" echo "

"

Step

Place the first line of code before the text you want to justify, and place the second line of code after the text. All text wrapped with the code is justified on the page.

Step

Save the changes and run the new code in your PHP debugger or in a Web browser. Notice the text is justified in the browser window.