0

Hello people,

I'm trying to collect some data stored between <body> and </body> tags inside a string.

Here's a piece of the code i'm using:

$regex = '/<body>(.*?)<\/body>/si';
	preg_match($regex, $content, $content);
	$content = $content[0];

This works perfect, except that it also includes the above mentioned tags. I would just like to grab the content in between those tags and store it.

In other words, only store the (.*?) part of the regex.

Anyone have an idea how to solve this? :)

Edited by macdonald12: n/a

1
Contributor
1
Reply
3
Views
7 Years
Discussion Span
Last Post by macdonald12
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.