作者 lyh

gx

@@ -437,8 +437,8 @@ function isEnglish($str) { @@ -437,8 +437,8 @@ function isEnglish($str) {
437 */ 437 */
438 function characterTruncation($string,$pattern){ 438 function characterTruncation($string,$pattern){
439 preg_match($pattern, $string, $matches); 439 preg_match($pattern, $string, $matches);
440 - if (isset($matches[1])) {  
441 - $result = $matches[1]; 440 + if (isset($matches[0])) {
  441 + $result = $matches[0];
442 return $result; // 输出:这是footer标签的内容 442 return $result; // 输出:这是footer标签的内容
443 } else { 443 } else {
444 return []; 444 return [];