Retrieve The link value form <a href> tag using php
问题 I need to extract the link value which is stored in a <a href> tag by using php code. <a href="http://stackoverflow.com/questions/ask"></a> From the above code i want to extract the link http://stackoverflow.com/questions/ask using php code. 回答1: There are a variety of options.. If you know the href will always be the one and only attribute on the a tag, you can find the position of the first and last double quotes using strpos/stripos and use substr to pull out the href. Alternatively, even