I was trying to extract the text of an html tag using regular expressions. It seems that preg_match_all is a good option to do this. I wanted to extract the taxonomy term name from within a views display template. I needed to embed a views inside another views. I needed to use part of the parent view's html as an argument for the nested view. I used preg_match_all to extract the term name from an html tag.
preg_match_all('/<title.*>(.+)<\/title.*>/uis', $contents, $matches);I found the one that did the trick for me here: http://www.usenet-forums.com/php-language/23218-extracting-specified-htm...
Post new comment