<?php

function GeneratePassword()
{
	$password = "";
	$password_length = rand(6,12);
	for ($i = 0; $i < $password_length; $i++)
	{
		$assci_segment = rand(1,3);
		if ($assci_segment == 1)
			$password .= chr(rand(48,57));	// numeric
		elseif ($assci_segment == 2)
			$password .= chr(rand(65,90));	// alpha upper case
		else
			$password .= chr(rand(97,122));	// alpha lower case
	}
	$search  = array('I', 'O', 'l');
	$replace = array('i', 'o', 'L');
	$password = str_replace($search, $replace, $password);
	return $password;
}

?>
