NameSilo

PHP function to make a serial code

Spaceship
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
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
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
•••
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back