- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$content = '<h2>Title of post</h2> 1 category <strong>task 1</strong> 1 category <strong>task 2</strong> 1 category <strong>task 3</strong> ';
preg_match_all('#<\/h2>(.*?)<strong>#',$content,$matches);
print_r($matches);