The code is as follows |
Copy Code |
$timestamp = time (); function open ($file, $type = ') { Global $fromurl, $referer; $cachename = $file; if ($type) { $file = '/'. $type. ' /'. $file; }else{ $file = $file; } if ($open =file ($file)) { $count =count ($open); for ($i =0; $i < $count; $i + +) { $theget. = $open [$i]; } }else{ Die (' Unable to connect to the source station network, please refresh '); } return $theget; } function Cut ($file, $from, $end) { $message =explode ($from, $file); $message =explode ($end, $message [1]); return $message [0]; } Function Curl ($openurl) { Global $isfun; if ($isfun = = "Curl") { $ch = Curl_init ($openurl); curl_setopt ($ch, curlopt_followlocation, 1); curl_setopt ($ch, Curlopt_returntransfer, 1); $file = curl_exec ($ch); Curl_close ($ch); } ElseIf ($isfun = = "fopen") { $file =open ($openurl); } else{echo "<script>alert (' your space does not support this program, thank you for using '); Window.close ();</script>";} return $file; } |
How to use
The code is as follows |
Copy Code |
$url = ' http://www.111cn.net '; $content = open ($url, 0); |
/*
The following function is used to determine whether a function is available
*/
code is as follows |
copy code |
function Isfun ($funName) { return (False!== function_exists ($ funname))? Yes:no; } ? |