• Does WP have a built-in function that can read the contents of a URI into a string? I’m using the function below but I’m curious if WP already has something for that I can use.

    function get_uri_contents($uri)
    {
    	if ( empty($uri) || !is_string($uri)) { return false; }
    	$ch = curl_init($uri);
    	curl_setopt($ch, CURLOPT_REFERER, $uri);
    	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    	$str = curl_exec($ch);
    	curl_close($ch);
    	return $str;
    }
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Get URI Contents’ is closed to new replies.