I have code that gets the first h1
tag from a webpage. Now I want to get the first img
tag that appears either before or after this h1
tag. How can I do this using PHP Simple HTML DOM?
How can I get the nearest img tag to an h1 tag using PHP simple HTML DOM?
537 views Asked by Ajay Mohite At
1
Not easily. However, this should probably work:
<h1>
as you have already<h1>
and repeat the entire process from Step 2.Trim steps as needed.