{"id":134,"date":"2010-01-05T15:00:41","date_gmt":"2010-01-05T23:00:41","guid":{"rendered":"http:\/\/blog.portnumber53.com\/?p=134"},"modified":"2010-01-05T15:00:41","modified_gmt":"2010-01-05T23:00:41","slug":"great-way-to-parse-html-content-using-php","status":"publish","type":"post","link":"https:\/\/blog.portnumber53.com\/index.php\/2010\/01\/05\/great-way-to-parse-html-content-using-php\/","title":{"rendered":"Great way to parse HTML content using PHP"},"content":{"rendered":"<p>Today I started improving a newsletter system in the company I work for. One of the things I wanted to change is to have images embedded in the email message.<\/p>\n<p>The website uses CodeIgniter (<a href=\"http:\/\/www.codeigniter.com\" target=\"_blank\" rel=\"noopener\">http:\/\/www.codeigniter.com<\/a>); for email handling I chose Swift mailer (<a href=\"http:\/\/swiftmailer.org\/\" target=\"_blank\" rel=\"noopener\">http:\/\/swiftmailer.org\/<\/a>). Then for HTML parsing to replace all the relative image paths and encode\/embedded the images in the message I found this parser: SimpleHTMLDOM (<a href=\"http:\/\/simplehtmldom.sourceforge.net\/\" target=\"_blank\" rel=\"noopener\">http:\/\/simplehtmldom.sourceforge.net\/<\/a>).<\/p>\n<p>Really simple to use and now I&#8217;m working on the rest of the stuff&#8230; managing templates for newsletter, handling subscription etc etc.<\/p>\n<p>I&#8217;m going to add some sample code later. Drop me a line if I take too long.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today I started improving a newsletter system in the company I work for. One of the things I wanted to change is to have images embedded in the email message. The website uses CodeIgniter (http:\/\/www.codeigniter.com); for email handling I chose Swift mailer (http:\/\/swiftmailer.org\/). Then for HTML parsing to replace all&#8230; <a class=\"continue-reading-link\" href=\"https:\/\/blog.portnumber53.com\/index.php\/2010\/01\/05\/great-way-to-parse-html-content-using-php\/\"> Continue reading <span class=\"meta-nav\">&rarr; <\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,4,18],"tags":[79,257,314,329],"class_list":["post-134","post","type-post","status-publish","format-standard","hentry","category-codeigniter","category-development","category-php","tag-codeigniter","tag-newsletter","tag-simplehtmldom","tag-swiftmailer"],"_links":{"self":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/134","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/comments?post=134"}],"version-history":[{"count":0,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/posts\/134\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/media?parent=134"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/categories?post=134"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.portnumber53.com\/index.php\/wp-json\/wp\/v2\/tags?post=134"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}