Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Generating Random String In PHP Using Brute Force

<?php
$n=10;
function getName($n) {
	$characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
	$randomString = '';

	for ($i = 0; $i < $n; $i++) {
		$index = rand(0, strlen($characters) - 1);
		$randomString .= $characters[$index];
	}

	return $randomString;
}
echo "Hello from Softhunt.net";

echo getName($n);
?>
Source by softhunt.net #
 
PREVIOUS NEXT
Tagged: #Generating #Random #String #In #PHP #Using #Brute #Force
ADD COMMENT
Topic
Name
3+5 =