Python Find Pattern In Array Function Php