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] - Mafiaking - TeamTNT ExClusive.mkv
Cradle 2 The Grave 2003 HDTVRip 720p Dual-Audio[Eng+Hindi] ~ BRAR
I have to seperated movie name and year
For getting year in use perg_match like
$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 //working perfect
But I also want to get movie name like
Divergent
Birdman
Cradle 2 The Grave
I also check with this link
Extracting movie name and year from string were year is optional
But nothing happen
How i get it? Please help or provide hint to achive it.