Code: Select all
function get_page_html($pagename, $start_tag, $end_tag){
$page_content = file_get_contents($pagename);
$from = strpos($page_content, $start_tag);
$to = strpos($page_content, $end_tag);
$page_part = substr($page_content, $from, $to - $from);
return $page_part;
}<!--Start_Tag-->
Some content
<!--End_Tag-->
<!--Start_Tag-->
Some different content
<!--End_Tag-->
Right now it returns only "Some content" but I'd like it to return both "Some content" & "Some different content" as one result string.
As always, any suggestions are welcome!
Tomas