I have managed to get this to work but it seems like it is a very long and messy solution. I was wondering if anyone had an idea of how this can be done better. I am new to php and don't know a lot.
It shows the text between the tags <h1> and </h1> from the content of a different file
Basically I had to start the substr() from the fourth position so it would actually skip the "<h1>" being included, and because I started on the fourth postion I then had to finish four places back to skip the "</h1>" being included.
<?php
$id = $_GET['id'];
$homepage = file_get_contents("./".$id.".php");
$title = stristr($homepage,"<h1>");
$titlepos = strpos($homepage,"</h1>");
$endpos = $titlepos - 4;
echo "Title " . substr($title,4,$endpos);
?>