Re: I thought this would be easy: Matching array elements inside of a while loop

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • John Moore

    Re: I thought this would be easy: Matching array elements inside of a while loop

    On Wed, 08 Oct 2008 17:54:45 -0400, in comp.lang.php Jerry Stuckle
    <jstucklex@attg lobal.netwrote:


    >You're only checking against the first element of the array
    >($_items[0]). You need to loop through the items array each time you
    >fetch a result.
    >
    >A better way would be to use in_array() to see if the currently fetched
    >item_id is in the $items array.
    Thanks- I'm having much better luck using in_array().


    J Moore
Working...