How can CSS be used to format text output in PHP?

To format text output in PHP using CSS, you can create a separate CSS file with the desired styles and then link it to your PHP file using the <link> tag. This allows you to define styles such as font size, color, alignment, and more for your text output. By separating the styling from the PHP code, you can easily make changes to the appearance of your text without modifying the logic of your PHP script.

&lt;!DOCTYPE html&gt;
&lt;html&gt;
&lt;head&gt;
    &lt;link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;styles.css&quot;&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;?php
    echo &quot;&lt;p class=&#039;styled-text&#039;&gt;This is a sample text output.&lt;/p&gt;&quot;;
    ?&gt;
&lt;/body&gt;
&lt;/html&gt;
```

styles.css:
```css
.styled-text {
    font-size: 16px;
    color: blue;
    text-align: center;
}