id10error
02-18-2005, 06:56 AM
Hi:
I am trying to create a very unique ID number. The code at the bottom works perfectly. What I really need is to modify the IP information (format) a bit for my database. Single digit numbers need to have 2 zero's in front of the number, double digit numbers need to have 1 zero in front of the number and triple digit numbers need not to be changed. Also, remove ALL the . (dot) and squeeze the numbers together.
Example:
IP 125.15.3.113
change to
125015003113
My Code:
$unique_customer_id = $$ . "-" . $ENV{'REMOTE_ADDR'} . "-" . time();
Can anyone help me with this please?
TIA
I am trying to create a very unique ID number. The code at the bottom works perfectly. What I really need is to modify the IP information (format) a bit for my database. Single digit numbers need to have 2 zero's in front of the number, double digit numbers need to have 1 zero in front of the number and triple digit numbers need not to be changed. Also, remove ALL the . (dot) and squeeze the numbers together.
Example:
IP 125.15.3.113
change to
125015003113
My Code:
$unique_customer_id = $$ . "-" . $ENV{'REMOTE_ADDR'} . "-" . time();
Can anyone help me with this please?
TIA