- print_r: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$str = "<li>Want this</li>DON'T WANT THIS<li>Want this</li>DON'T WANT THIS<li>Want this</li>";
preg_match_all('/<li>(.*?)<\/li>/', $str, $out);
echo '<pre>';
print_r($out);