sophielois1
Technical User
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
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