Teach you how to segment an article as required .? Php $ a: This is a small paragraph. see it; $ a. This is a small sentence !; $ A. Last sentence ?; $ A. This is the result !; In fact, this is a long sentence. $ Bsplit ([.!?], $ A, 4); end ,! No. $ A = "this is a small paragraph. See It ";
$ A. = "this is another sentence! ";
$ A. = "Last sentence? ";
$ A. = "this is the result! ";
// In fact, this is a long sentence.
$ B = split ("[\.\! \?] ", $ A, 4 );
// Full stop ,! Number and question mark are segmented according to your own requirements
For ($ index = 0; $ index {
Print "$ index. $ B [$ index]
";
}
// Read the array in a loop.
?>
Http://www.bkjia.com/PHPjc/315902.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/315902.htmlTechArticle? Php $ a = This is a small paragraph. see it; $ a. = This is a small sentence !; $ A. = last sentence ?; $ A. = This is the result !; // In fact, this is a long sentence. $ B = split ([\.\! \?], $ A, 4); // end ,! ...