主要是符合当前百度搜索的需求,把内容进行数字符号的添加,分点来叙述答案内容,具体看代码:
<?php
header("Content-type:text/html; charset=utf-8");
$text = $_GET['mtx'];
$arr = multiexplode(array("[","!","?",";",".","!","?",";","。","]"),$text);
if(count($arr)-1>0){
for($i = 0;$i<=count($arr)-1;$i++){
if($i>1){
if(!empty($arr[$i])){
echo "<p>".($i-1). "." . $arr[$i] . "</p>";
}
}else{
echo "<p>". $arr[$i] . "</p>";
}
}
}else{
echo $text;
}
function multiexplode ($delimiters,$string) {
$ready = str_replace($delimiters, $delimiters[0], $string);
$launch = explode($delimiters[0], $ready);
return $launch;
}
?>
文章来源于网络或者作者投稿,若有侵权请联系删除,作者:老钟,如若转载,请注明出处:https://www.laoz.net/1214.html