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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.