preg_replace (syntax between two word not match then replace or url syntax not match

Started on the old forum in December 2014 · view the original in the archive · old links redirect here

2 replies · 130 views · started 11 years ago · 1 min read

3 participants
cflash Junior · 20 posts #1
$string = '<a href="https://www.uptime.com/v/_JM?version=3" />PLAY</a></div>
<a href="https://newtime.uptime.com/v/_JM?version=3" />LINK@</a></div>
<div class="class"><a href="https://www.firstdot.com/dsljdlkj@4sjdkjcnc/jdhdd.html" />LINKUP</a></div>
<a href="https://subdomain.uptime.com/v/_@%ljdmmcc=3" />subd</a></div>
<a href="https://www.cng.com/v/_JM?dkkkk#3" />GETUp</a></div>
';

remove Link except .uptime.com HOw Can Get Result From String (OUTPUT)

<a href="https://www.uptime.com/v/_JM?version=3" />PLAY</a></div>
<a href="https://newtime.uptime.com/v/_JM?version=3" />LINK@</a></div>
<div class="class"></div>
<a href="https://subdomain.uptime.com/v/_@%ljdmmcc=3" />subd</a></div>
</div>
something else Fellow · 2,296 posts #2
$string = explode("</div>",$string);
$output = '';
foreach ($string as &$v) 
{
    if(strpos ($v, 'uptime.com'))
    {
        $output += $v;
    }
}

echo $output;
arnage Lead · 811 posts #3

Im not getting what did he wanted. 🤨

<!DOCTYPE html PUBLIC "-//***WAPFORUM**.**RS***

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close