2015-11-20 80 views
0

我想讀取遠程文件的某些行是代碼PHP和WordPress我怎樣才能讀取遠程文件中的某些行

    // get bio from remote servers from line 835 to 859 
       $userbio = fopen("http://example.com/".$db->username, 'r'); 
       $lineNo = 0; 
       $startLine = 865; 
       $endLine = 892; 
       while ($line = fgets($userbio)) { 
        $lineNo++; 
        if ($lineNo >= $startLine) { 
         echo $line; 
        } 
        if ($lineNo == $endLine) { 
         break; 
        } 
       } 
       fclose($userbio); 

而且在單一的PHP文件這一偉大工程,但裏面的時候我得到的所有WordPress資源ID#164。 任何其他方式做這個遠程閱讀? 謝謝

回答

0

嘗試的file_get_contents()函數,導訪w3school