Teach you how to divide an article into paragraphs as required_PHP tutorial

WBOY
Release: 2016-07-21 16:04:33
Original
1524 people have browsed it

$a="This is a short paragraph. Take a look";
$a.="This is another short sentence!";
$a.="The last sentence?";
$a.="This is the result!";
//Actually, this is a long sentence.

$b=split("[.!?]",$a,4);
//Absolute period,! Numbers, question marks, etc. are segmented according to your own requirements

for($index=0;$index{
print "$index.$b[ $index]
";
}
//Read the array in the loop.

?>

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/315902.htmlTechArticle?php $a=This is a short paragraph. Look; $a.=This is another short sentence! ; $a.=The last sentence?; $a.=This is the result!; //Actually, this is a long sentence. $b=split([.!?],$a,4); //Full stop,! No....
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template