(still don't know what to call the topic, better then HELP NEEDED i guess. lol)
i am challenging my amature brains again, and once again, need some help...
Sample code snippet...
Code: Select all
<?
//NSW Warnings
if ($query = "IDN36501.txt")
{$state = "NSW";
$filename = "Flood Watch 1.txt";
}
if ($query = "IDN28500.txt")
{$state = "NSW";
$filename = "NSW Severe Weather Warning.txt";
}
if ($query = "IDN36501.txt")
{$state = "NSW";
$filename = "Flood Watch 1.txt";
}
if ($query = "IDN28500.txt")
{$state = "NSW";
$filename = "NSW Severe Weather Warning.txt";
}
if ($query = "IDN36501.txt")
{$state = "NSW";
$filename = "Flood Watch 1.txt";
}
if ($query = "IDN28500.txt")
{$state = "NSW";
$filename = "NSW Severe Weather Warning.txt";
}
//VIC Warnings
if ($query = "IDV20200.txt")
{$state = "VIC";
$filename = "Coastal Wind Warning East of Wilsons Prom.txt";
}
?>Now the above code works fine but the main problem is the number of different $query *.txt files numbers close to 300, and sorted into 7 different $states.
I have setup 7 files like this...
Now this is just a small sample, but i am wanting a script that sees the above, mathces the if ($query) statment with the ID code and performs the $filename change with the corosponding title after the = sign...IDS20201 = Coastal Wind Warning 1
IDS20202 = Coastal Wind Warning 2
IDS20210 = Ocean Wind Warning
IDS20230 = Storm Tide Warning
IDS20235 = Storm Tide Advice
IDS20240 = Road Weather Alert
IDS20242 = Sheep Graziers' Advice
IDS20270 = Severe Weather Warning
IDS20280 = Severe Weather Advice 1
IDS20282 = Severe Weather Advice 2
IDS20300 = Flash Flood Warning
IDS20360 = Gawler River Flood Warning
IDS20362 = Torrens Flood Warning
IDS20364 = Onkaparinga Flood Warning
IDS20366 = Brownhill Creek Flood Warning
IDS20370 = Inland Flood Warning
Any help in doing this would be much appreciated..