在PHP中如何读取文本文件并将每行放入数组中?
我发现这个代码在某种程度上做了它,但是找了一个=标志,我需要寻找一个新的代码:
<?PHP
$file_handle = fopen("dictionary.txt", "rb");
while (!feof($file_handle) ) {
$line_of_text = fgets($file_handle);
$parts = explode('=', $line_of_text);
print $parts[0] . $parts[1]. "<BR>";
}
fclose($file_handle);
?>
Run Code Online (Sandbox Code Playgroud) php ×1