Php functions for obtaining remote file content ,. Php functions for obtaining remote file content, a simple php function code for obtaining remote file content, strong compatibility. You can easily obtain the content of a remote file by calling this php function,
A simple php function code for obtaining remote file content, which is highly compatible. You can use this function to obtain the content of a remote file. The code is as follows:
/*** Read remote content ** @ return string */function get_url_content ($ url) {if (function_exists ("curl_init") {$ ch = curl_init (); $ timeout = 30; curl_setopt ($ ch, CURLOPT_URL, $ url); curl_setopt ($ ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt ($ ch, CURLOPT_CONNECTTIMEOUT, $ timeout ); $ file_contents = curl_exec ($ ch); curl_close ($ ch);} else {$ is_auf = ini_get ('allow _ url_fopen ')? True: false; if ($ is_auf) {$ file_contents = file_get_contents ($ url) ;}return $ file_contents ;}
The above is the function code for php to obtain remote file content. I hope this article will help you to learn about php programming.
Secret, a simple php function code for obtaining remote file content, with strong compatibility. You can use this method to obtain the content of a remote file...