PHP:Format Printing

From Progzoo
Jump to: navigation, search

You can print formatted numbers using the printf function.

You can build a string using printf. The %8d place holder will ensure that the number takes exactly 8 spaces.

Right justified...:   54321
Two decimal places:    3.14
Hexadecimal.......:    d431
Left Justified....:54321   :


[Font] [Default] [Show] [Resize] [History] [Profile]