Monday, March 20, 2017

Laravel, Dom, how to get all h2 tags instead of one?

I've created an xml file with all the results of my SEO scan. Now i'm trying to output everything on a details page per scan.

How do i get all h2 tags to save into my database? PHP_EOL doesn't work. This is my code. Normally i would use PHP_EOL after the nodeValue but that doesn't work in my controller.

Im using Laravel 5.4.

foreach ($htag2 as $node) {
  $ts->h2_tag = $node->nodeValue;
}



via itvba

Advertisement