You can use regex for this
<?php
function getInbetweenStrings($start, $end, $str){
$matches = array();
$regex = "/$start([a-zA-Z0-9_]*)$end/";
preg_match_all($regex, $str, $matches);
return $matches[1];
}
$str = "<asdfasf?>dsdafs<asfasdfasf?>";
$str_arr = getInbetweenStrings('<', '\?>', $str);
print_r($str_arr);
The quite similar question is this one: Get substring between two strings PHP
EDIT
Of course for different arguments you need to change the function arguments :-)
$str = "<abcasdfasf>dsdafs<abcsfasdfasf>";
$str_arr = getInbetweenStrings('<abc', '>', $str);
print_r($str_arr);
Also be aware that the code will split the string that contains only specific characters - [a-zA-Z0-9_].
Consider learning regular expression first a bit.
Cheers!