I want to split text message into array at every Space. It's been working just fine until I received this text message. Here is the few code lines that process the text string:
$str = 'T bw4 05/09/19 07:51 am BW6N 499.803';
$cleanStr = iconv("UTF-8", "ISO-8859-1", $str);
$strArr = preg_split('/[\s\t]/', $cleanStr);
var_dump($strArr);
Var_dump yields this result:
array:6 [▼
0 => "T"
1 => b"bw4 05/09/19"
2 => "07:51"
3 => "am"
4 => "BW6N"
5 => "499.803"
]
The #1 item in the array "1 => b"bw4 05/09/19"" in not correct, I am not able figure out what is the letter "b" in front of the array value. Also, the space(es) between "bw4" and "05/09/19" Any suggestion on how better achieve the string splitting are greatly appreciated. Here is the original string: https://3v4l.org/2L35M and here is the image of result from my localhost: http://prntscr.com/jjbvny