test.txt的內容
89, -71, 279, 208 -104
71, -71, 279, 208 -104
73, -71, 279, 208 -104
73, -71, 279, 208 -104
66, -71, 279, 208 -104
63, -71, 279, 208 -104
80, -71, 279, 208 -104
這是我看範例從字串裡取代空白練習的程式碼
<?php
$fn = " This line contains liberal use of whitespace.";
$fn = trim($fn);
$fn = preg_replace('/\s(?=\s)/', '', $fn);
$fn = preg_replace('/[\n\r\t]/','', $fn);
?>
想要把檔案讀進去並取代裡面的空白及連續空白
請教大大,我該怎麼修改