freeloader Posted February 11, 2007 Share Posted February 11, 2007 Hi guys, I have a code that gets connects with a webserver through cURL, and retrieves a page with a table. I need only 2 columns, but i need them linked together. I use a global var for that and store it as $globalvar[element1] = 'element2'; the way I go through the result of the webpage is with preg_match_all. Is preg_match_all the fastest solution in this case? Sometimes it needs to do over 1000 pages in a row so i'm really looking for the fastest way here Thanks in advance. Quote Link to comment Share on other sites More sharing options...
freeloader Posted February 12, 2007 Author Share Posted February 12, 2007 This question is not going to get answered on page 50 Bump. Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted February 12, 2007 Share Posted February 12, 2007 I am not quite getting what you are asking... Are just retrieing the source html from a file and parsing it? or is this curl request returning query results from another database table... Could just be me but I don't think your question is very well explained. Quote Link to comment Share on other sites More sharing options...
btherl Posted February 12, 2007 Share Posted February 12, 2007 I doubt you'll get faster than a regular expression. Parsing the document will take much longer. And ereg is slower than preg, so you've made the right choice there The only way I can imagine you might do it faster would be by making an educated guess and truncating the document before you do the matching. You may be able to safely remove some data from the front and end. As always, benchmark any change to see if you actually made it slower by trying to be too smart Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.