How can I intercept a character? 
This post was last edited by sky94132003 on 2014-07-10 17:31:54 
Like a lot of news.
 
The format is very regular using XXXXXXX, XXX. Xxxxxx,xxxxx.
 
How to do, intercept the first occurrence. and the previous text
Or the second time it appears. and previous previous text
 
such as the following scarlet letter
 
  References 
 Speaking here, you have accepted the CSDN Forum's user code of conduct. please be responsible for your words and deeds, and abide by the laws and regulations of the People's Republic of China, respect online ethics. Reprint article Please indicate from "CSDN (www.csdn.net)". For commercial use, please contact the original author. 
  
How to use PHP to intercept intelligently? First or second sentence of one ". "To calculate a sentence 
------Solution-------------------- 
 
$s = ' speak here, indicating that you have accepted the CSDN Forum user code of conduct. Please be responsible for your words and deeds, and abide by the laws and regulations of the People's Republic of China, respect online ethics. Reprint article Please indicate from "CSDN (www.csdn.net)". For commercial use, please contact the original author. ';
echo preg_replace ('/(?:. +?. {1}). +/', ' $ ', $s);
Speaking here, you have accepted the CSDN Forum's user code of conduct. 
 
echo preg_replace ('/(?:. +?. {2}). +/', ' $ ', $s);
Speaking here, you have accepted the CSDN Forum's user code of conduct. Please be responsible for your words and deeds, and abide by the laws and regulations of the People's Republic of China, respect online ethics. 
 
------Solution-------------------- 
Use explode to. Number segmentation is also possible.