<?php$url = "xxx";$content = file_get_contents($url);$pattern = '#<code[^>]*?id="searchWord"[^>]*?>\s*(\[".*?\])</code>#is';if(preg_match($pattern, $content, $match)) { echo $match[1];} else { //匹配不到数据(可能是正则没写对)}