79679685

Date: 2025-06-25 21:27:48
Score: 0.5
Natty:
Report link

Regex can do the trick. Note that I've used the "s" flag, so a "." includes new lines - normally the first capture group would start at the beginning of the current line, rather than the beginning of all text:

echo preg_replace('/.*(?<=<body>)(.*)(?=<\/body>).*/s', '$1' ,$data); // get body text only
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: will