Search code examples
phphtmltextformattingtext-to-html

Text to HTML in PHP


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.


Solution

  • 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