So, I got two arrays. First $main:
(
[0] => 4035
[1] => 10065
[2] => 10034
[3] => 10039
[4] => 4035 // <- this is key 0 from $inmain
[5] => 4035 // <- this is key 2 from $inmain
[6] => 4096 // <- this is key 1 from $inmain
)
And second $inmain that looks like this:
(
[0] => 4035
[1] => 4096
[2] => 4035
)
I want to detect if all keys from $inmain are “close” (regardless of order) to each other in the $main array. E.g. you can see that they are now (but in a different order) on keys 4, 5, 6.
I guess I’ll just convert those arrays to ‘strings’ like that:
$mainstr = "1000111"and$inmainstr = "111"and than use strpos()