Exactly the same as Phil posted but changed the file name.
PHP Code:
<?php
$file = "list.txt";
$srt = file_get_contents($file);
$array = preg_match_all("#<li><a\s+name=\"(?:[^\"]+)\"\s?>([^<]+)</a></li>#is", $str, $matches);
foreach( $matches[1] as $key => $inner_text ) {
$url_insert = urlencode( $inner_text );
$str = str_replace($matches[0][$key], "<li><a href=\"http://www.google.com.au/search?q=" . $url_insert . "\">" . $inner_text . "</a></li>", $str);
}
$array = preg_match_all("#<li>([^<]+)</li>#is", $str, $matches);
foreach( $matches[1] as $key => $inner_text ) {
$url_insert = urlencode( $inner_text );
$str = str_replace($matches[0][$key], "<li><a href=\"http://www.google.com.au/search?q=" . $url_insert . "\">" . $inner_text . "</a></li>", $str);
}
echo $str;
?>