php number format
A simple question.
I have integer variable $a=2, how can I display it in string format: "SN0002" with 4 '0' inserted? thanks.
michael123
Junior Poster in Training
94 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0
Thanks for the reply.
I also found another way to do that:
$order_num ="SN".str_pad($a,5,0,STR_PAD_LEFT);
michael123
Junior Poster in Training
94 posts since Jun 2005
Reputation Points: 10
Solved Threads: 0