如何使用preg_match
or将目标空白添加到锚标记以在新窗口中打开preg_replace
?
$contentss = file_get_contents("http://www.ncbi.nlm.nih.gov/pubmed?LinkName=pubmed_pubmed&from_uid=18032633" );
preg_match('/<div class="rprt">(.*)<\/div>/',$contentss,$matches);
$patterns = '/\/pubmed/';
$replacements = 'http://ncbi.nlm.nih.gov/pubmed';
$getreplacements = ( preg_replace($patterns, $replacements, $matches));
echo $getreplacements[0];