PHP Programs

Please click on 1-2 Ads to keep this website's Study Material FREE and regularly Updated.

Program 26: Write a PHP program to generate simple random password [do not use rand() function] from a given string.


<!DOCTYPE html>
	<title>PHP Progarms</title>
		function password_generate($chars)
			$data = '1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
			return substr(str_shuffle($data), 0, $chars) ;

		echo password_generate(7) . "\n";

If you have any suggestion or found any error in the above program, then do let us know at [email protected] or just comment below.