Welcome Guest, Not a member yet? Register   Sign In
Extract body using regular expression
#1

[eluser]Dsyfa[/eluser]
Hi,

I'm trying to extract the body of a view file using regular expression but it doesn't work.
Code:
$body = $this->load->view( 'newsFeed', '', true );
$regex = "@\<body\>(.*?)\</body\>@i";
$matches = array();
preg_match ( $regex, $body, $matches );
print_r( $matches );
The view file is basically simple:
Code:
<html>
<head>
    <title>Hello</title>
</head>
<body>
    Hello World!
</body>
</html>


Messages In This Thread
Extract body using regular expression - by El Forum - 02-11-2008, 03:53 AM
Extract body using regular expression - by El Forum - 02-11-2008, 05:10 AM
Extract body using regular expression - by El Forum - 02-13-2008, 11:27 PM



Theme © iAndrew 2016 - Forum software by © MyBB