我有一个 html 页面,其中包含以下标签的多个实例:
<INCLUDEFILE-1-/var/somepath/file1.php>
<INCLUDEFILE-2-/var/somepath/file2.php>
<INCLUDEFILE-3-/var/somepath/file3.php>
<INCLUDEFILE-4-/var/somepath/file4.php>
<INCLUDEFILE-5-/var/somepath/file5.php>
我可以使用什么代码来提取上面的所有路径?到目前为止,我已经获得了以下代码,但无法使其正常工作:
preg_match_all('/INCLUDEFILE[^"]+/m', $html, $result, PREG_PATTERN_ORDER);
for ($i = 0; $i < count($result[0]); $i++)
{
$includefile = $result[0][$i];
}
我需要提取:
/var/somepath/file1.php
/var/somepath/file2.php
/var/somepath/file3.php
/var/somepath/file4.php
/var/somepath/file5.php
谁能看到明显的错误?!