I’ve tried searching for a solution online but have had no luck (i´m a PHP beginner). I have two strings (collection of phone numbers with a time-stamps) that have comma separated values. I need to check if a specific part of text between the commas from sting A can be found in string B.
Here is an example of sting A:
9858264-2012-12-05T00:11:28.806Z,1265482-2012-12-05T22:19:49.769Z,9598643-2012-12-05T22:46:17.115Z,
Here is an example og sting B:
5555649-2012-12-05T22:37:23.765Z,3594595-2012-12-05T22:44:36.363Z,8549851-2012-12-05T22:46:01.259Z,9598643-2012-12-05T22:46:09.600Z
In the above strings, the below two values are very similar (only few seconds in the time-stamp are different):
From string A: 9598643-2012-12-05T22:46:17.115Z
From string B: 9598643-2012-12-05T22:46:09.600Z
What I need to do is COUNT the number of values between commas in string A that match in string B apart from the last 5 characters in the time-stamp as those could be the same occurrences but with +/- a few seconds apart.
I have thought of using php explode to get every value into an array and then comparing them, but I´m rather lost at this point when it comes to array and also on how to compare one array value to the other minus the last 5 characters of an value.
You could do something like this.