From 0f4e4faf9d9493300d00020e8123b61d8d94aaf2 Mon Sep 17 00:00:00 2001 From: LMR <59361885@qq.com> Date: Tue, 28 May 2024 14:12:19 +0800 Subject: [PATCH] add @@@ --- application/controllers/infofix.php | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/application/controllers/infofix.php b/application/controllers/infofix.php index 91caffe0..cbee836f 100644 --- a/application/controllers/infofix.php +++ b/application/controllers/infofix.php @@ -55,7 +55,8 @@ class infofix extends CI_Controller $pos_content = mb_stripos($info->ic_content, $key); $sub_content = array(); while ($pos_content) { - array_push($sub_content, '[...' . mb_substr($info->ic_content, $pos_content - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'); + $_str = '[...' . mb_substr($info->ic_content, $pos_content - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; + array_push($sub_content, str_replace($key,'@@@'.$key.'@@@',$_str)); $pos_content = mb_stripos($info->ic_content, $key, $pos_content + mb_strlen($key)); } @@ -66,7 +67,8 @@ class infofix extends CI_Controller $pos_content2 = 0; $pos_content2 = mb_stripos($info->amp_json, $key); while ($pos_content2) { - array_push($sub_content2, '[...' . mb_substr($info->amp_json, $pos_content2 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'); + $_str = '[...' . mb_substr($info->amp_json, $pos_content2 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; + array_push($sub_content2, str_replace($key,'@@@'.$key.'@@@',$_str)); $pos_content2 = mb_stripos($info->amp_json, $key, $pos_content2 + mb_strlen($key)); } } @@ -77,7 +79,8 @@ class infofix extends CI_Controller $pos_content3 = 0; $pos_content3 = mb_stripos($info->amp_body, $key); while ($pos_content3) { - array_push($sub_content3, '[...' . mb_substr($info->amp_body, $pos_content3 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'); + $_str = '[...' . mb_substr($info->amp_body, $pos_content3 - $limitStr, mb_strlen($key) + $limitStr * 2) . '...]'; + array_push($sub_content3, str_replace($key,'@@@'.$key.'@@@',$_str)); $pos_content3 = mb_stripos($info->amp_body, $key, $pos_content3 + mb_strlen($key)); } }