Load time: is it quicker to parse HTML with PHP's DOMDocument or with Regular Expressions?
问题 I'm pulling images from my Flickr account to my website, and I had used about nine lines of code to create a preg_match_all function that would pull the images. I've read several times that it is better to parse HTML through DOM. Personally, I've found it more complicated to parse HTML through DOM. I made up a similar function to pull the images with PHP's DOMDocument, and it's about 22 lines of code. It took awhile to create, and I'm not sure what the benefit was. The page loads at about the