Best way to generate transaction id for a point of sale appl

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Post Reply
User avatar
simplypixie
php-forum Active User
php-forum Active User
Posts: 300
Joined: Sun Dec 11, 2011 12:51 am
Location: Shrewsbury, Shropshire
Contact:

Re: Best way to generate transaction id for a point of sale

Post by simplypixie » Tue Feb 19, 2013 10:27 pm

Code: Select all

$date = date('Ymd');
$numbers = '0123456789';
for ($i=0; $i<$4; $i++) {
		$rand_num.=$numbers{rand(0,strlen($numbers)-1)};
	}
$transaction_id = 'PO'.$date.''.$rand_number;

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests