海南seo排名网站用户体验优化方案
需求:
前端展示:
(1)之前的页面:

(2)修改后的页面:
 
之前接口返回的数据 :

 解决办法:提取tags 中的  ’约' 的数组 添加到一个新的数组中去
        1:一开始想到的是 使用strops 的函数  返回 存在的位置  ,但是 字符串知道了位置 不是很方便 获取到相应的值。(试了很久 结果不是很理想)
         2:使用正则表达式  (处理这种需要 直接正则 ,不要考虑strops,array_search ,或者其他的 的函数了):
        foreach ($item['good'] as &$index) {$pattern = '/约.*/';preg_match_all($pattern, implode(', ',$index['tags']), $matches);$index['tag'] =  explode(',', implode(",", $matches[0]));} 
