It can be easily done using this small function:
function getString($string, $from, $to) {
$str = explode($from, $string);
$str = explode($to, $str[1]);
return $s[0];
}
$myString = "Some code";
print getString($myString, '', '');
// Prints: Some code