-1

I would like to extract season number and episode number from websites links with PHP

Here the example that have the same format I want :

https://3sk.tube/video-watch-turkish-mosalsal-moases-othman-online-download-episode-38?Drivename=othamn.S02E04.mp4

This is the part that presents at all link : Drivename=othamn.S02E04.mp4

Where season number is : 2 and episode number is 4

I would like to extract those season number and episode number using PHP.

Ryan M
  • 18,333
  • 31
  • 67
  • 74
Mr LEEE
  • 3
  • 1
  • 1
    What did you search for, and what did you find? What did you try, and how did it fail? – tripleee Dec 14 '20 at 04:39
  • Does this answer your question? [How to get parameters from a URL string?](https://stackoverflow.com/questions/11480763/how-to-get-parameters-from-a-url-string) – kelvin Dec 14 '20 at 04:45

1 Answers1

0
$drivename = $_GET['Drivename'];
$season = preg_replace("/^(.*?)(\.S)(.*?)E.+$/", '\\3', $drivename);
$episode = preg_replace("/^(.*?)(\....E)(.*?)\..+$/", '\\3', $drivename);
  • Thanks a lot it is working 100% :D I was able to extract any season or episode from the site : https://m.33sk.tube – Mr LEEE Dec 16 '20 at 00:33