2017-04-03 10 views

答えて

0

このスタック応答は部分的にあなたの質問に:https://stackoverflow.com/a/13246630/6535806、ちょうど$lineのル長さを取得するにはしばらく必要があります。コードは次のようになります:

$handle = fopen("filename.extention", "r"); 
// if the file exist 
if ($handle) { 
    // for each line 
    while (($line = fgets($handle)) !== false) { 
     // write the length of the line 
     echo strlen($line).'<br />'; 
    } 
    // then we close the file opened 
    fclose($handle); 
} else { 
    // error opening the file. 
} 
関連する問題