Php - How can I search an array for a certain value?

Kavrocks

New member
The array I want to search for a certain value is:

Array ( [0] => 1 [ID] => 1 [1] => Division 1 [Year] => 2010 [2] => Division 2 [3] => Division 3A [4] => Division 3B [5] => Division 4 [6] => [7] => [8] => )

I want to check if a variable $division is in the array above. The var $division will either hold the value 'Division 1', 'Division 2', 'Division 3A', Division 3B' or 'Division 4' if it is true or if it is false it will hold something else and I will kill the script. The variable $division will be equal to a global $_GET variable.
Can anybody help?

I've tried in_array(), array_search(), array_key_exists() but no matter way I use them I cant get the script to turn out true even if the value submitted is correct.
 
Back
Top