Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

query array

Status
Not open for further replies.

sophielois1

Technical User
May 2, 2006
16
GB
Hi,

Looking for some help with the following.

$location =='somewhere';

I want to query the following array. If $location = any of the keys within the following array, then do someting, if not do something else. I know I can use if / else statemnet just not sure how to check all the contents of the array against $location.

$no = array( 'Cornwall' , 'Cumbria' , 'Durham' , 'East Riding of Yorkshire' , 'EastEssex' , 'Essex' , 'Herefordshire' , 'Hertfordshire' , 'Humberside' , 'Isle of Wight' , 'Isles of Scilly' , 'Kent' , 'Middlesex' , 'Norfolk' , 'Northern Ireland' , 'North Yorkshire' , 'Northumberland' , 'Rutland' , 'Scotland' , 'Shropshire' , 'South Yorkshire' , 'Suffolk' , 'Tyne and Wear' , 'Wales' , 'Westmorland' , 'West Yorkshire' , 'Yorkshire') ;

Many thanks for any help

Sophxx

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top