I have a function that I want to be able to accept either an html string, or a resource that file_get_contents() can work on.
My basic idea is
function something($source){
$local = true;
foreach(array('http://', 'https://') as $protocol)
if(stripos($source, $protocol) === 0)
$local = false;
//more stuff
}
which works,
But I am curious, is there a better way of doing this, and if not, what other protocols can file_get_contents() handle
It’s normal way.
Supported Protocols and Wrappers