fork download
  1. <?php
  2.  
  3. $html = <<< EOF
  4. <div>another words</div>
  5. <div>
  6.   some text here
  7. </div>
  8. EOF;
  9.  
  10. preg_match('%<div>\s+(.*?text.*?)\s+</div>%s', $html, $result);
  11. $result = $result[1];
  12. echo $result;
  13.  
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
some text here