|
Posted by Aaron Saray on 09/01/07 14:27
Just a thought: you might want to try doing array_search() against
$outerArray[0] - as that will search the outer array's first array -
which I believe is your unique IDs.
If your second array is values associated with your first array, you
might want to try keying your array by the unique id's you're
generating, and set the value to the 'aa' or 'bb' or whatever.
-aaron
On Aug 31, 4:46 pm, "Jeff" <it_consulta...@hotmail.com.NOSPAM> wrote:
> php 5.x
>
> In my php I define an multidimensional array like this:
> $test = array(array(1, 0 , 3), array('aa', 'dd', 'cc'));
>
> I need to seach the first array ( array(1, 0 , 3) ) of $test for a value...
>
> The first array ( array(1, 0 , 3) ) get it's values from using mt_rand to
> generate random values. I want these integer values to be unique... so I
> need to perform an if-test on the genereated number - if number already
> exist then generate another number and check that one too, until a unique
> number is generated
>
> I'm not sure how to do it so please if you have any suggestions on how to it
> then please post your suggestion here
>
> Jeff
Navigation:
[Reply to this message]
|