Array highest value or create next value?
<p>I have an array of names and id's.</p>

<pre><code>Array(
    0=&gt;array(
        name=&gt;New York, 
        id=&gt;45763448349, 
        can=0
    ),
    1=&gt;array(
        name=&gt;New York2, 
        id=&gt;45763464566, 
        can=0
    ),
    3=&gt;array(
        name=&gt;New York3, 
        id=&gt;45763464854, 
        can=0
    ),
    4=&gt;array(
        name=&gt;New York4, 
        id=&gt;45763464955, 
        can=0
    ),
    5=&gt;array(
        name=&gt;New York5, 
        id=&gt;45763464745, 
        can=0
    ),
    6=&gt;array(
        name=&gt;New York6, 
        id=&gt;45763464235, 
        can=1
    )
)
</code></pre>

<p>For example (there will be different names (not all New York)) and I have an x variable with a name (for example x=New York) what I need to do is find the highest name and get the id and then make sure can is 1 otherwise specific the next highest name.</p>

<p>For example let's assume that I have x=New York so I look through the array and find that the highest array name is New York6. I see that can=1 so I just get the id. Now if can != 1 then I could specific New York7.</p>

<p>NOTE: This array will contain many different values (not all New York, I just used those for an example)</p>

<p>Now how on earth would I even get started?</p>
