Evaluating array content (PHP, XenForo)


New Member
I'm having few troubles when evaluating an array data to filter some content. I'm sending to the template an array with few numbers (1,4,5,10,12,14,20 - for example) and then i want to filter if it has a specific value.
Let's say i want to know if it has '2' as a single value. What would be the best method?
I was using (strpos ($array, '2') !== false) but then i noticed that it checks if 2 is inside the array and not if it's just '2', so it returned true.
I need to be able to evaluate if '2' is specified as '2' and not if it's on the array string (like on '20' or '12').
PS: Although using xenforo(zend), any answer on php should be enough.
Hope you can help, Thanks!

Từ khóa phổ biến

You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an alternative browser.