$url = $_POST['url'];
if(isset($url) && $url!=''){
$html = file_get_contents($url);
preg_match('/
(.*?)<\/h1>/ism',$html,$title_arr);
preg_match('/(.*?)/ism',$html,$desc_arr);
$xmldata ="
-
";
write_to_xml($xmldata);
}
#####################################################
function write_to_xml($data){
$file=$_SERVER["DOCUMENT_ROOT"]."/watch/read/upsc.xml";
$fp_hp=fopen($file,"w");
fwrite($fp_hp, $data);
fclose($fp_hp);
}
?>
UPSC GUIDE XML