[ Team LiB ] Previous Section Next Section



Are there any other string functions that might be useful to me?


Yes. PHP has about 60 string functions! You can read about them all in the PHP online manual at http://www.php.net/manual/ref.strings.php.


In the example that demonstrated printf(), you showed the formatting by wrapping your output in <pre> tags. Is this the best way of showing formatted plain text on a browser?


<pre> tags can be useful if you want to preserve plain-text formatting in an HTML context. If you want to output an entire text document to the browser, however, it is neater to tell the browser to format the entire output as plain text. You can do this with the header() function:

Header ("Content-Type: Text/Plain");

    [ Team LiB ] Previous Section Next Section