Jump to content

Recommended Posts

Hi,

 

First of all, thx for reading!

For a new subtitle project, I want to know whether the search string contains a series or not. And, if this is a release or not.

 

Possible options for a $searchstring:

$searchstring = "The.Big.Bang.Theory.S02E01.REAL.PROPER.HDTV.XviD-NoTV";
$searchstring = "The_Big_Bang_Theory.2x09.The_White_Asparagus_Triangulation.HDTV_XviD-FoV";
$searchstring = "the big bang theory s02e01";
$searchstring = "the big bang theory";

 

Now, how can I figure out if this is a request for a series or not?

Second, the first two are releases while the last two are not. How can I distinct between them? By using the '.'?

 

Thanks a lot, I've been searching&trying for hours with substr, preg & more. Hope you guys can help, thx!

 

Link to comment
https://forums.phpfreaks.com/topic/157024-check-if-search-string-contains-series/
Share on other sites

Can you elaborate on that a little bit, when you say series and release, are you talking about the item they are searching for? 

 

If I am interpreting your question correctly, that would depend on information in the database you are searching.

how should we know whether the string is a series or not? That's just random data to someone on the outside.  You need to explain what in the string makes it a series or not.  Same thing with your question about whether its a release or not.  Sure, I could tell that the last 2 don't have dots in it, so check if there's dots in there, but that may or may not help you.  How would I know whether releases in general would have dots in them or not? It's all just random arbitrary data to us outsiders. 

 

In other words, you need to explicitly define what constitutes a series and release.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.