Extract body using regular expression - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Extract body using regular expression (/showthread.php?tid=5989) |
Extract body using regular expression - El Forum - 02-11-2008 [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 ); Code: <html> Extract body using regular expression - El Forum - 02-11-2008 [eluser]Seppo[/eluser] Try this: Code: $regex = "@\<body\>(.*?)\</body\>@is"; If I'm not wrong, you have to use "s" flag so . includes the new line character Extract body using regular expression - El Forum - 02-13-2008 [eluser]Dsyfa[/eluser] Thanks mate! It works now! |