In a text file, ugly lines, for example:
0000000438, add, file 10/24 / 2015.06: 57: 06, "Bank", "6.20.31.32.00", "2031 / Main",
I brought them to the following form:
10.24.2015 06:57:06 Bank 6.20.31.32.00 2031.Main
I did this as follows:
$a_temp = file("temp66.txt"); $num = count($a_temp); //количество строк в файле temp66.txt for ($i = 0; $i < $num; $i++) { $read = $a_temp[$i]; $string = substr($read, 20, -2); //припудрим строки $trans = array("/" => ".", "," => " ", "\"" => ""); $print = strtr($string, $trans); But the other day I discovered that the lines are not formatted.
How to format strings in a different way?