Jump to content

[SOLVED] How to search for a href links in the content


ted_chou12

Recommended Posts

I wish to know the string to use when you are using the function preg match, and grab the link in the a href of the html codes see the eg below:

This is a <a href="link.php">link</a>, please visit!

I wish to know how to get the link.php of the eg. shown using preg match function.

Thanks

Ted

Link to comment
Share on other sites

sorry, I wish to add something here, I want links of my own domain, so that:

This is a <a href="link.php">link</a>, please visit!

This is a <a href="http://mydomain.com/link.php">link</a>, please visit!

This is a <a href="http://www.mydomain.com/link.php">link</a>, please visit!

Will all work, however:

This is a <a href="http://otherdomains.com/link.php">link</a>, please visit!

This is a <a href="http://www.otherdomains.com/link.php">link</a>, please visit!

will not work.

and whatever form the link is in, I only want the link of my pages in the form link.php, or somedirectory/link.php.

Thanks again.

Ted

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.