0

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 ?

1 Answer 1

1

The pre-tag would work.

<pre>
<?php echo htmlspecialchars(file_get_contents($url)); ?>
</pre>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.