user977151
user977151

Reputation: 505

reading file php

The file I'm using to read has a lot of tabs and when I echo using nlb12, it doesn't output the tab space. Does anyone know if there's a way to keep the tab space when you're outputting file contents?

Upvotes: 0

Views: 66

Answers (4)

haltabush
haltabush

Reputation: 4528

You want to show the file in a browser? Then you have to use <pre><?php echo $line;?></pre>

Upvotes: 0

qJake
qJake

Reputation: 17139

echo '<pre>' . print_r($MyVariable, true) . '</pre>';

Upvotes: 0

Adam Hopkinson
Adam Hopkinson

Reputation: 28795

Output it in <pre> tabs

echo "<pre>" . nl2br($content) . "</pre>";

Upvotes: 0

Rick Kuipers
Rick Kuipers

Reputation: 6617

Try wrapping the output in <pre></pre> tags.

Upvotes: 1

Related Questions