Are there any potential pitfalls or limitations when trying to print text content directly from PHP on a Linux server?

When trying to print text content directly from PHP on a Linux server, one potential pitfall is not properly handling special characters or formatting. To avoid this issue, it is recommended to use PHP's htmlentities() function to encode special characters and ensure proper display of text content.

<?php
$text_content = "This is some text content with special characters like < and >";
echo htmlentities($text_content);
?>