aşağıdaki şekilde denermisiniz
siz preg_match ile işlem yaparken
preg_match_all('@
bu kısıma iyi bakarsanız her li style="text-decoration:underline; içermiyor haliyle sadece o stili içerenleri gösteriyor sorgunda || (yada) ekliyerek istediğiniz sonucu elde edersiniz
isterseniz kendi baglan fonksiyonunuzu kullanabilirsiniz
$headers = [
':authority:nobet.org',
':method:POST',
':path:/latlng.html',
':scheme:https',
'accept:*/*',
'accept-encoding:gzip, deflate, br',
'accept-language:tr-TR,tr;q=0.8,en-US;q=0.6,en;q=0.4',
'origin:https://nobet.org',
'referer:https://nobet.org/istanbul/nobetci-eczaneler.html',
'user-agent:Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36',
'x-requested-with:XMLHttpRequest'
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_ENCODING , "gzip");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$cikti = curl_exec ($ch);
curl_close ($ch);
return $cikti;
}
$baglan = Baglan ('https://nobet.org/istanbul/nobetci-eczaneler.html');
preg_match('@(.*?)
@si',$baglan, $eczane3);
preg_match_all('@(.*?) ||(.*?) @si',$eczane3[1] , $eczane5);
print_r($eczane5);
?>