I have some HTML and I need to get link and text from the anchor tag.
$pattern = '/href="(.*)".*>(.*)<\/a>/'
I didn't get exact link from above pattern but If I used the following pattern
$pattern = '/href="(.*?)".*>(.*)<\/a>/'
I get the desired result, But I didn't understand what question mark (?) does here and why I don't get result If I am not using the question mark (?).
No comments:
Post a Comment