robert_gsfame Posted April 18, 2012 Share Posted April 18, 2012 I have this function to get other website title tag. But since the fopen is disabled in my shared server, this function cannot work. How can i still do it? thx in adv function getTitle($Url){ $file=@fopen($Url,"r"); if($file) { fclose($file); $str=file_get_contents($Url); if($str) { if(strlen($str)>0){ preg_match("/\<title\>(.*)\<\/title\>/",$str,$title); return $title[1]; } }else{ return true; } }else{ return false; } } Quote Link to comment https://forums.phpfreaks.com/topic/261147-fopen-is-disabled/ Share on other sites More sharing options...
xyph Posted April 18, 2012 Share Posted April 18, 2012 Read up on cURL, though it could be disabled as well. Quote Link to comment https://forums.phpfreaks.com/topic/261147-fopen-is-disabled/#findComment-1338297 Share on other sites More sharing options...
trq Posted April 18, 2012 Share Posted April 18, 2012 Your code doesn't use the results from the call to fopen anyway. Quote Link to comment https://forums.phpfreaks.com/topic/261147-fopen-is-disabled/#findComment-1338358 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.