faysalahmed.wordpress.com
searching an element inside array in php
You can use in_array function. here is a quick example taken from [1]