How to match all h1-h6 tags in PHP

For matching all H tags in html code you need to do this:

preg_match_all('/<h([1-6]).*[^>]*>(.*)<\/h([1-6])>/',$content,$all_h_tags);

Where $content is a string variable with html tags and $all_h_tags is a variable where all matches are put.


Hello

It is my first blog entry.

In this blog I would write about web technologies and how their use in modern web development.