Yes and NO , because it substrreturns a string, which is the needle in your case and FALSE on failure, in which case it will not be a valid function argument in_array.
First you have to extract part of the string using substr, and you need to make sure that you have extracted some string, and it did not return FALSE, only then you should use it in in_array.
source
share