Posted on

Partial string search in an array using PHP

String Search in PHP

I couldn’t find an out-of-the-box PHP function to do a partial string search in an array of strings. So I had to write a simple helper function using strpos for a WordPress project, I am working on.

Partial string search in an array using strpos

Here is the gist in case you need it.

Let me know in comments if you think there is a better alternative available.

Leave a Reply

Your email address will not be published. Required fields are marked *