Is there a more efficient way to filter large arrays than preg_match()?
Posted
by
hozza
on Programmers
See other posts from Programmers
or by hozza
Published on 2012-03-31T12:29:06Z
Indexed on
2012/03/31
17:42 UTC
Read the original article
Hit count: 198
I have a log that our web application builds. Each month it contains around 16,000 entries of a string with about the average sentence worth of text.
To filter/search through these in our admin panel the script uses preg_match()
but this seems to be taking ages and timing out on the 30sec limit. I have isolated that it is indeed the preg_match()
that causes the time out.
Is there a more efficient way to search through values in a large array for a users input?
© Programmers or respective owner