Ross wrote:
I am retrieving the vlaue from an associative arrray but do I need to do it
in with two lines of code? The numerical value is stroed in the DB.
$region_array = array('a' =>'All of Scotland', 1 =>'Aberdeen City Council',
2 =>'Aberdeenshire Council', 3 =>'AngusCouncil', 5 =>'Argyll and Bute
Council', 6 => 'Clackmannanshire Council', 9 =>'Dumfries and Gallowalloway',
10 => 'Dundee City Council', 11 => 'East Ayrshire Council', 13 => 'East
Dunbartonshire', 14 => 'East Lothian Council', 15 => 'East Renfrewshire
Council', 16 =>'Edinburgh City Council', 17 =>'Falkirk Council', 18 =>'Fife
Council', 20 =>'Highland Council', 21 =>'Inverclyde Council', 22
=>'Midlothian Council', 23 => 'Moray Council', 24 =>'North Ayrshire
Council', 25 =>'North Lanarkshire Council', 26 =>'Orkney Islands Council',
27 =>'Perth & Kinross Council', 28 => 'Renfrewshire Council',29 =>'Scottish
Borders Council', 30 => 'Shetland Isles Council', 31 =>'South Ayrshire
Council', 32 => 'South Lanarkshire Council', 33 => 'Stirling Council', 34
=>'West Dunbartonshire', 35 => 'West Lothian Council', 8 => 'Comhairle nan
Eilean');
$convert=$row['area'];
$area= $region_array['$convert'];
$area = $region_array[ $row['area'] ];
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php