<a href="/onw">one</a>
<a href="twoo">one</a>
<a href="#">three</a>
<a href="https://mysite.ru">four</a>"
<a href="https://mysite.ru/news">five</a>"
<a href="https://vk.com/feed">six</a>"
href=\"(http:\/\//https:\/\/)все_кроме_mysite.ru
href="(https?:\/\/(?!mysite\.ru\/?).+?)"
foreach( $links as $link ){
if( stripos( $link, $siteName ) === false ){
if( preg_match('#^(http\:\/\/|https\:\/\/)#', $link) ){
// Some actions
}
}
}
Find more questions by tags Regular expressionsPHP
what? here the division of tasks, in order not to bathe with the regular season, the second step cut off everything that leads to other resources.
If purely by the regular season, without the hassle, then the solution has already shown Mikhail Osher - Kaylah_Mraz82 commented on July 8th 19 at 15:34