Jump to content

[SOLVED] Please help


beyzad

Recommended Posts

i just quickly wrote this

should be okay

<?php

echo RandomChar(10, true);
echo "<br>";
echo RandomChar(50, false);

function RandomChar($length, $unique = true)
{
$chars1 = range('A', 'Z');
$chars2 = range('a', 'z');
$charset =array_merge($chars1, $chars2);
$nums = range('0', '1');
$charset =array_merge($charset, $nums);

if(count($charset) < $length && $unique)
{
	die("CharSet less than $length Chars");
}
$Rand = "";
shuffle($charset);
if($unique)
{
	foreach($charset as $R)
	{
		$Rand .= $R;
	}
	$Rand = substr($Rand, 0,$length);
}else{
	for($n;$n<$length;$n++)
	{
		$k = array_rand($charset);
		$Rand .= $charset[$k];
	}
}
return $Rand;
}
?>

 

 

Link to comment
https://forums.phpfreaks.com/topic/76488-solved-please-help/#findComment-387437
Share on other sites

n~ link=topic=166828.msg734950#msg734950 date=1194517501]

Hi, i found this one, little close  ;D

 

<?php
$numbers = range(1, 25);
shuffle($numbers);
foreach ($numbers as $number) {
    $k = $number;
    echo "$k";
}

?>

 

Special thanks to you. :-* :-*

And special thank to Mr MadTechie .

Both are wonder.

Thanks.

Link to comment
https://forums.phpfreaks.com/topic/76488-solved-please-help/#findComment-387454
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.