Speeding up the script, or the SQL Query?
Ok first of all. I'll explain what I'm trying to achieve.
This is a little script that will take a post similar to this one, and from a list of cards from a table in the database, compare it and if the words match, then it will add a [card]MATCHED WORD[/card] ([card] tags around the matched word). Code:
I tested the SQL query and it's not the slow part. Now it's the eregi_replace. I wanted to use str_replace but it's case sensitive and str_ireplace is only available in PHP5 (I'm using PHP4). So, I need some way to speed up the egeri_replace while loop. Am I doing this as fast as possible? Is there any way I could speed this search and replace up? Can anyone help me? Sorry if my english is bad. |
preg_replace is FASTER than eregi_replace
I figured out how to make it faster .... You can delete this wheneever, sorry for wasting anyone's time ... ~cheers |
All times are GMT -5. The time now is 08:28 PM. |