2011-06-18 1 views
0

私は、html文字列、またはfile_get_contents()が処理できるリソースを受け入れることができるようにする機能を持っています。urlまたはstringを受け入れる関数?

私の基本的な考え方は、作品

function something($source){ 
    $local = true; 
    foreach(array('http://', 'https://') as $protocol) 
    if(stripos($source, $protocol) === 0) 
     $local = false; 
    //more stuff 
} 

、 である。しかし、私は好奇心、これを行うのは良い方法があり、そうでない場合は、他のどのようなプロトコルがfile_get_contents()

答えて

関連する問題