The LIKE clause is a very nifty feature.

It is also an incredibly expensive operation.

Use it judiciously, and consider alternative means of processing data.

Don't use PHP to process data.