Leading Zeros in Character fields

A

Anonymous

Guest
Hi,

use the following technique to retain the 0's while inserting into table or whenever you want.

Code:
str_pad($HOLDID, 3 , "0");

here is assume $HOLDID = 1
your total length of the character is 3 and
0 is the digit that you want to retain with value 1 or other numbers
 
Back
Top