[ Team LiB ] Previous Section Next Section

Q&A

Q1:

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

A1:

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.

Q2:

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?

A2:

<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