I think this is what you are looking for:
$title = 'Motive S01E13 HDTV x264 EVOLVE eztv'; preg_match('/s\d\de(\d\d)/i', $title, $matches); echo $matches[1];
This will print 13 as you search. It will work with any similar formatted string and will always output the episode number (subject to the S00E00 format). It is also case insensitive if you're interested.
source share