目前我有一个如下所示的代码片段:
echo '<div id="content">';
echo '<b>Results:<br></b>';
echo '<div style="margin-right: 230px; margin-top: -20px;"><center><a href="http://clubpenguincheatsnow.com/tools/itemdatabase/"><b>Back</b></a><center></div>';
$string = explode('<br>', $string);
foreach ($string as $row) {
preg_match('/^(.+)\s=\s(\d+)\s=\s(\D+)\s=\s(\d+)/', trim($row), $matches);
if (preg_match("/$query/i", "$matches[1]")) {
echo "<a href='http://clubpenguincheatsnow.com/tools/itemdatabase/info.php?id=$matches[2]'>";
echo $matches[1];
echo "</a><br>";
}
}
echo '</div>';
如您所见,我在顶部和底部有 div 标签echo '<div id="content">';
echo '</div>';
。我想做的是我的 PHP 代码扫描两个标签之间的输出,如果文本<b>Results:<br></b><div style="margin-right: 230px; margin-top: -20px;"><center><a href="http://clubpenguincheatsnow.com/tools/itemdatabase/"><b>Back</b></a><center></div>
在标签之间,我希望我的代码输出“测试”。关于我的问题的任何帮助都会非常有帮助!