text file_get_contents txt function ch re tex file_get_contents re pre

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<?
$text=file_get_contents('1.txt');
function ch($re){
$tex=file_get_contents($re[1]);
preg_match("/<title>(.*?)<\/title>/",$tex,$tit);
$title="<a href=\"$re[1]\">".$tit[1]."</a>";
print_r($tit);
}
$text=preg_replace_callback("/<a href=\"(.*?)\">(.*?)<\/a>/","ch",$text);
file_put_contents('1.txt',$text);
?>