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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

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

    PHP Code:
    $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)


    HTML Code:
    <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>

    #2
    PHP Code:
    $string explode("</div>",$string);
    $output '';
    foreach (
    $string as &$v
    {
        if(
    strpos ($v'uptime.com'))
        {
            
    $output += $v;
        }
    }

    echo 
    $output

    Comment


      #3
      Im not getting what did he wanted.
      <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

      Comment

      Working...
      X