August 4, 2010

Text to HTML in PHP

Question by user409257

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.

Answer by Starx

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

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!