extract text from tag

后端 未结 2 1112
予麋鹿
予麋鹿 2020-12-18 17:24

Hi I\'ve got these lines here, I am trying to extract the first paragraph found in the file, but this fails to return any results, if not it returns results that are not eve

2条回答
  •  爱一瞬间的悲伤
    2020-12-18 18:05

    Try this:

    $html = file_get_contents("http://localhost/foo.php");
    preg_match('/

    (.*)<\/p>/', $html, $match); echo($match[1]);

提交回复
热议问题