PHP function to extract a string inside a string given a start and end point.