<?php $links = [ "https://www.booking.com/hotel/it/nh-collection-venezia-palazzo-barocci.en-gb.html", "https://www.booking.com/it/nh-collection-venezia-palazzo-barocci.en-gb.html" ]; $pattern = '~^https?://.*?/hotel~'; foreach ($links as $link) { if (!(substr($link, 0, 4 ) === "http" && strpos($link, '/hotel/') !== false)) { echo "No match $link" . PHP_EOL; continue; } }
You have javascript disabled. You will not be able to edit any code.