Jump to content

Again another trick problem of string


mars_rahul

Recommended Posts

i use preg_match function to select the links from the string.

 

that is fine for all types of links but  my problem is a bit different.

 

i have different types of links in my string.

such as: -

 

1. Internal links of my website.(refers to the next page link). admin/index.php.

2. Other links in website

                  a). Refers to name of my website that is  say: - www.xyz.com

                  b). Refers to external link. such as www.google.com.

here is the code: -

 

 

<?php
$str = "this is the content. <a href = http://www.google.com>For google</a>. links to my own website is as <a href://www.xyz.com>My website</a> with other internal link as <a href= "admin/index.php"> for admin panel</a>";

?>

now i only want to extract those links that are www.xyz.com (that is my own website) with all its internal links (describes as admin panel as above).

is there anybody to help me out.

 

Link to comment
https://forums.phpfreaks.com/topic/82034-again-another-trick-problem-of-string/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.