Formatting with PHP actually isn't done with PHP, it's done with HTML. You can do this in two ways. You can add the HTML inside of the PHP... or you can add the PHP inside of the HTML. Either way, make sure your file is saved as a .php or another file type that is allowed to execute PHP on your server.
Let's do something simple.... let's make our text red!
HTML inside PHP
Notice how we include the HTML code right inside of the echo.
<?php echo "<font color=#ff0000>Hello World!</font>"; ?>
PHP inside HTML
In the second example we simply insert a line of PHP inside our HTML. Although here it is only a line to make the text red, this could be inside a fully formatted HTML page, to get any look you want.
<font color=#ff0000> <?php echo "Hello World!"; ?> </font>