我试图将案文分为以下几句:
$delimiterList = array(" ", ".", "-", ",", ";", "_", ":",
"!", "?", "/", "(", ")", "[", "]", "{", "}", "<", ">", "
", "
",
" );
$words = mb_split($delimiterList, $string);
在我不得不与人数有关的一些情况下,我被困。
E.g. If I have the text "Look at this.My score is 3.14, and I am happy about it.". Now the array is
[0]=>Look,
[1]=>at,
[2]=>this,
[3]=>My,
[4]=>score,
[5]=>is,
[6]=>3,
[7]=>14,
[8]=>and, ....
Then also the 3.14 is divided in 3 and 14 which should not happen in my case. I mean point should divide two strings but not two numbers. It should be like:
[0]=>Look,
[1]=>at,
[2]=>this,
[3]=>My,
[4]=>score,
[5]=>is,
[6]=>3.14,
[7]=>and, ....
但是,我没有想避免这种情况!
没有人想如何解决这一问题?
Thanx, Granit