- explode: documentation ( source)
<?php
function string_between($string, $start, $end)
{
$parts = explode($start, $string);
if (isset($parts[1])) {
$parts = explode($end, $parts[1]);
return $parts[0];
}
return null;
}
echo string_between('volume: 90%', 'volume: ', '%');