PHP Questions Home

Categories

Arrays
Files
Forms
Functions
Images
MySQL
Numbers
Others
Strings
Website


PHP Functions

PHP Functions


More PHP

Top Questions
Ask a Question

How do I format the output of a string?


If you wish to format the output of a string, then you need to use the printf function, think of it in terms of 'print formatted'.

There are a large range of uses for this function and rather than repeat the detailed documentation, take a look at the PHP manual page on sprintf here:

http://uk3.php.net/manual/en/function.sprintf.php

More strings PHP Questions

How do I make the first letter of each word upper case?
How do you check if a variable is set or not in PHP?
How do I fetch the meta tags from a webpage using PHP?
How do I remove space from the start of a PHP string?
How do I reverse a string in PHP?