Great, but now a new problem comes...
$thearray[] = array("url"=>"http://localhost",
"weight"=>"8");
$thearray[] = array("url"=>"http://www.php.net",
"weight"=>"1");
and now I want randomly chose an array of url, but each url have different weight (defined by the weight array), and have the chance of chose the array which contain http://localhost 8 times larger than the other.
is there any way to do that? because your explaination made there are no way of putting other values in the array because you can't just assign the array numbers to something else...
[0] => 1
[1] => 2
[2] => 2
[3] => 8
[4] => 8
[5] => 8
[6] => 8
[7] => 8
[8] => 8
[9] => 8
[10] => 8
like now, how do you know which one could be assigned another value, because you can't get enough info of from this for me to assign other things to some of those arrays, you can't just replace all the 8 into something else because there might be other things that weights 8 when the script get larger...(maybe it's possible.. but I just can't think of a way to do it)