Howdy Guys,
What I am trying to do is the following: I have an array of values, these values will eventually be used to generate a random unique string but that's a little later. First I would like to loop through all the values in the array (foreach loop) then I would like to limit this (while loop) Is this a correct method for doing this?
The below code does not work, can anybody see what I'm doing wrong?
<?php
$array = array(
'1', '2', '3', '4', '5', '6', '7', '8', '9', '0',
'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j',
'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't',
'u', 'v', 'w', 'x', 'y', 'z', '!', '£', '$', '%',
'^', '&', '*', '(', ')', '_', '+', '{', '}'
);
$length_of_unique_key = 15;
$counter = 0;
foreach($array as $values)
{
$counter++;
while ($counter <= $length_of_unique_key)
{
}
}
?>