私のコード:
$string="655:47 Text: 0 n\some more text here\t\2\r\3\tl\0\f0\\f1\\f2\\a0\0\a1\0\a2\255";
$a=explode("\\",$string);
var_dump($a);
私が得る出力は次のとおりです。
array(7) {
[0]=>
string(33) "655:47 Text: 0 n"
[1]=>
stringl20) "some more text
0"
[2]=>
string(2) "f1"
[3]=>
string(2) "f2"
[4]=>
string(3) "a0"
[5]=>
string(3) "a1"
[6]=>
string(3) "a2"
}
関数を分解して正しく機能させたいのですが、見つかったすべての'\'チャットで文字列を分割したい(それでもすべての値を保持したい)。どうすればこれを解決できますか?