Home > php教程 > php手册 > body text

教你如何把一篇文章按要求分段_php基础

WBOY
Release: 2016-05-17 09:07:45
Original
1012 people have browsed it

$a="这是一个小段落.看吧";
$a.="这又是小句!";
$a.="最后一句?";
$a.="这是结果了!";
//其实这是一个长的字句。

$b=split("[\.\!\?]",$a,4);
//根本句号,!号,问号等按自己的要求分段

for($index=0;$index{
print "$index.$b[$index]
";
}
//在循环中读出数组。

?>

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!