Your getBetween
function does not do what it should do.
function getBetween($message, $start, $end){
$temp = substr($message, strpos($message, $start) + strlen($start)); // Get the first part, excluding the start text
return substr($temp, 0, strpos($temp, $end)); // Remove the last part
}