如果我在网站 1 上有此设置:
<div class="awesomeContent">
<div>
Information goes here...
</div>
<div>
Information goes here...
</div>
<div>
Information goes here...
</div>
</div>
如果我在网站 2 上使用它:
<?php
$data = file_get_contents('http://website.com/hello);
preg_match_all ("/<div class=\"awesomeContent\">([^`]*?)<\/div>/", $data, $matches);
print_r($matches[0]);
我希望它发布:
<div class="awesomeContent">
<div>
Information goes here...
</div>
<div>
Information goes here...
</div>
<div>
Information goes here...
</div>
</div>
但我得到的只是
<div class="awesomeContent">
<div>
Information goes here...
</div>
我怎样才能更好地做到这一点?