Reputation: 143
How can i print out an formatted HTML file ? This is my current code:
echo htmlspecialchars(file_get_contents($url));
But the result looks so ugly, all sticks together, no space no tabs. Is there any way to print the file exactly like the original file ?
Upvotes: 0
Views: 537
Reputation: 833
The pre-tag would work.
<pre>
<?php echo htmlspecialchars(file_get_contents($url)); ?>
</pre>
Upvotes: 1