I have a file name like this
Birdman.2014.DVDSCR.X264-PLAYNOW.mkv
Divergent (2014) 720p Blu-ray x2649 [Dual-Audio] [English DD 5.1 + Hindi DD 5.1] - Mafia - TeamTNT ExClusive.mkv
Cradle 2 The Grave 2003 HDTVRip 720p Dual-Audio [Eng + Hindi] ~ BRAR
I need to separate the movie name and year
Per year of using perg_match, for example
$s="Divergent (2014) 720p Blu-Ray x2649 [Dual-Audio][English DD 5.1 + Hindi DD 5.1] - Mafiaking - TeamTNT ExClusive.mkv"; if (preg_match('/\b\d{4}\b/', $s, $matches)) { $year = $matches[0]; } echo $year;
result: - 2014 // works fine
But I also want to get the name of the movie, for example
diverging
Birdman
Cradle 2 Grave
I also check this link
Retrieving the movie name and year from the string was valid optional
But nothing happens
As I understand? Please help or give us a hint.
user4904106
source share