Here is the code I'm using:
function get_string_between($string, $start, $end){
$string = ' ' . $string;
$ini = mb_strpos($string, $start);
if ($ini == 0) return '';
$ini += mb_strlen($start);
$len = mb_strpos($string, $end, $ini) - $ini;
return mb_substr($string, $ini, $len, mb_detect_encoding($string));
}
$string = '<div>財物類</div>';
$parsed = get_string_between($string, '<div>', '</div>');
echo $parsed;
Here is the result I'm getting: 財物類
The result I obviously want is: 財物類