This is very easy to do using SimpleXML:
$a = new SimpleXMLElement('<a href="www.something.com">Click here</a>');
echo $a['href']; // will echo www.something.com
More Related Contents:
- PHP String Manipulation: Extract hrefs
- how to extract links and titles from a .html page?
- How to get the first word of a sentence in PHP?
- Please rectify this syntax error echo ” ” Add to cart “”; [closed]
- How can I get a hex dump of a string in PHP?
- Remove new lines from string and replace with one empty space
- PHP: Split string [duplicate]
- Mixing a PHP variable with a string literal
- PHP equivalent of .NET/Java’s toString()
- How to mimic Stack Overflow Auto-Link Behavior
- How can I truncate a string to the first 20 words in PHP?
- Remove control characters from PHP string
- Convert flat array to a delimited string to be saved in the database
- Split string by new line characters
- string sanitizer for filename
- PHP function to delete all between certain character(s) in string
- How do you pull first 100 characters of a string in PHP
- How to convert a string to JSON object in PHP
- Get the first letter of each word in a string
- Separate space-delimited words in a string [duplicate]
- Close open HTML tags in a string
- Return the portion of a string before the first occurrence of a character in PHP [duplicate]
- How to check if letter is upper or lower in PHP?
- How to implode array with key and value without foreach in PHP
- Why a function checking if a string is empty always returns true? [closed]
- How to convert array values to lowercase in PHP?
- PHP string doesn’t allow < and > characters
- PHP remove commas from numeric strings
- PHP function to replace a (i)th-position character
- PHP Find all occurrences of a substring in a string