I have a text file like:
en-US -> www.google.co.uk
en-UK -> www.bbc.co.uk
es-CO -> www.somedomain.com
I want to be able to pick out the country/language type for example en-US and the corresponding domain name on the same line. How do I do this?
A start:
$file = "data.txt";
$f = fopen($file, "r");
while ( $line = fgets($f, 1000) ) {
if (preg_match('/^-> .*$/', $line)) {
fwrite($out, $fh);
}
print $line;
}