PHP function to make a serial code

Namecheap AuctionsNamecheap Auctions
SpaceshipSpaceship
SpaceshipSpaceship
Watch

axilant

Account Closed
Impact
28
This is a function say your making a signup script and you want them to have a activation code or something. Its pretty usefull, only edit the function if you know what you are doing!!! It can actually mess up and might not give a good output.
PHP:
function make_serial($string)
{
	$md5 = md5($string);
	$split = str_split($md5, 4);
	foreach($split AS $tmp)
	{
		    $serial .= "$tmp-";        
	}
	$tmp = substr($serial, 0, 39);
	return $tmp;
}
//usage:
$string = "axilant";  //might want to encrypt there username or something, you can deside that :)
$serial = make_serial($string);
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Thats awesome, I never knew PHP had a function for that. I might build that into my next Online Game for some added protection.
 
1
Close
CatchedCatched

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back