views:

54

answers:

2

Hello, nl2br(); can do for EOL but what about white spaces and/or tabs at the beginning(or not) of line? Is there any function to do this at once? I need well formatted html output of text file. Thx.

+2  A: 

well may be <pre>....</pre> can do it

also see

htmlspecialchars()

http://php.net/manual/en/function.htmlspecialchars.php

htmlentities()

http://www.php.net/manual/en/function.htmlentities.php

Starx
Thx. How to mark it as done? You are very useful. Greetings.//EDIT: Ok. I can do it after some time.. 2 min. left..
A: 

It is OK to use "pre" HTML tag.

<?php
echo '<pre>' ;
/// .... do text output stuff...
echo '</pre>' ;
?>

Sorry for my lame question. I'm new in WoW(word of web).