fork download
  1. <?php
  2.  
  3. $regexp = '#<h2>Related Anime</h2>(.+?)<h2>#s';
  4. $html = '
  5. <h2>Related Anime</h2>Adaptation: <a href="/manga/418/Mushishi">Mushishi</a><br>Sequel: <a href="/anime/21329/Mushishi_Special:_Hihamukage">Mushishi Special: Hihamukage</a>, <a href="/anime/21939/Mushishi_Zoku_Shou">Mushishi Zoku Shou</a><br>
  6. <br />
  7. <h2>
  8. ';
  9. preg_match($regexp, $html, $dig);
  10.  
  11. var_dump($dig);
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
array(2) {
  [0]=>
  string(258) "<h2>Related Anime</h2>Adaptation: <a href="/manga/418/Mushishi">Mushishi</a><br>Sequel: <a href="/anime/21329/Mushishi_Special:_Hihamukage">Mushishi Special: Hihamukage</a>, <a href="/anime/21939/Mushishi_Zoku_Shou">Mushishi Zoku Shou</a><br>
		<br />
		<h2>"
  [1]=>
  string(232) "Adaptation: <a href="/manga/418/Mushishi">Mushishi</a><br>Sequel: <a href="/anime/21329/Mushishi_Special:_Hihamukage">Mushishi Special: Hihamukage</a>, <a href="/anime/21939/Mushishi_Zoku_Shou">Mushishi Zoku Shou</a><br>
		<br />
		"
}