作者 lyh

gx

@@ -123,6 +123,18 @@ class LoginController extends BaseController @@ -123,6 +123,18 @@ class LoginController extends BaseController
123 $templateModel = new Template(); 123 $templateModel = new Template();
124 $list = $templateModel->list(); 124 $list = $templateModel->list();
125 foreach ($list as $k => $v){ 125 foreach ($list as $k => $v){
  126 + // 使用正则表达式和 preg_match_all 函数来匹配多个 img 标签的 src 值
  127 + preg_match_all('/<img src="([^"]+)"/', $v['html'], $matches);
  128 + if (!empty($matches[1])) {
  129 + $srcValues = $matches[1];
  130 + var_dump($srcValues);
  131 + die();
  132 + foreach ($srcValues as $srcValue) {
  133 + echo $srcValue . "<br>";
  134 + }
  135 + } else {
  136 + echo "未找到 img 标签的 src 值";
  137 + }
126 $data['html'] = str_replace( 138 $data['html'] = str_replace(
127 'https://develop.globalso.com/a/image/', 139 'https://develop.globalso.com/a/image/',
128 'https://ecdn6.globalso.com/public/template/', 140 'https://ecdn6.globalso.com/public/template/',