array_rand use in while loop
Hello, I'm new to php/coding in general and have recently been offered some terrific code in response to a question:
... but I'm still trying to understand it, and this forum seems better place for open-ended discussion than SO.
The main thing I'm having trouble following is this line (from Pudge601):
$dist = $dists[$index][array_rand($dists[$index])];
... which seems to (paradoxically) randomly create the first level of the stated array as the second level within the same array. :eek:
Could anyone explain what is going on there in 'English'? I suspect if I could really grok that like the rest of the script would fall into place. Thanks!