Ankur
Ankur

Reputation: 2901

How can I find linked images in PHP?

I want to take some html content and operate on a few particular attributes in a few particular tags.

I am trying to implement the following algorithm in PHP:

I am trying to implement this within a wordpress plugin so we can assume that I have all the functionality of that platform available.

What methods/techniques can i use to implement this? i am really bad with regular expressions so i was hoping there might be an easier way to do this or if anyone can recommend a good way to build the regular expressions, that would be acceptable too.

any help would be greatly appreciated!

Upvotes: 1

Views: 127

Answers (2)

PeeHaa
PeeHaa

Reputation: 72652

Whatever you do don't try to parse the HTML using regex!

Parse it with a parser :)

For example DOM.

Upvotes: 1

Matchu
Matchu

Reputation: 85784

This sounds like a good job for an HTML parser :)

Upvotes: 0

Related Questions