Hello,
Is it possible to split the contents of file into parts that have specific pattern?
This is what I want to achieve:
- Read the file using file_get_contents
- Read only contents between similar commented areas.
I am not sure how complicated is that but basically If I am parsing a large html file and want only to display to the browser the specific widgets (pattern is the comment boundaries) like this:
Sample:
<html>
<head>
<title>test</title>
</head>
<body>
this content should not be parsed.. ignored
<!-- widget -->
this is the widget. i want to parse this content only from the file
<!-- widget -->
</body>
</html>
would it be possible using php and regex or anything to parse the contents between boundaries only?
I apologize but I tried to explain what I want to achieve as much as I can. hope someone helps me.