Home
PHP
Chart
Class
Components
Cookie Session
Data Structure
Data Type
Date
Design Patterns
Development
DNS
Email
File Directory
Form
Functions
Graphics Image
HTML
Language Basics
Login Authentication
Math
MySQL Database
Network
Operator
PDF
Reflection
Statement
String
Utility Function
Web Services SOAP WSDL
XML
Menu
Using left zero padding : str_pad « String « PHP
PHP
String
str_pad
Using left zero padding
<?php printf(
"Zero padding can help alignment %05d."
, 42); ?>
Related examples in the same category
1.
str_pad() function pads string to length pad_length with a specified characters
2.
str_pad-2.php
3.
str_pad.php
4.
string str_pad ( string input, int length [, string padding [, int type]] )
5.
Make use of str_pad()'s optional parameters
6.
STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH:
7.
There is an optional third parameter to str_pad( ) that lets you set the padding character to use
8.
Using left space padding