I need help to increase the speed of my PHP code.
I parsing items in groups of 20 pages that have 700 lines in them so if I deal with more then one group it becomes really slow.
Ok, you wanna see the code, ummm, sorry, but i'll give you the rest of the dirt.
I use the file(""); to make every line of the Doc an array element of $file.
So this is a big array.
Then run a while loop to extract one array element at a time, explode it, check to see it is what I am looking for, if it is move down a couple of more lines, run another very small while loop (7 times) check to see if that line meets the criteria. Then start over.
Oh, I can show you some code
This already works so if you see some syntax errors it cause I edited fast so you guys can see
while (list($ii,$i) = each($file))
{
$parts = explode(">",$i);
if ($parts[0] == "match this")
{ $parts2 = explode("<", $parts[1]);
$position[0] = $parts2[0];
$parts3 = explode('"',$file[$ii+3]);
$position[1] = $parts3[1];
}
// Declare Variables for new Loop
GLOBAL $CurInfo ;$CurInfo = 0;
while ($CurInfo < 7)
{ if (!empty($info[$CurInfo]))
{if (strstr($position[1],$info[$CurInfo]))
{$found[$a] = $position[0];$found[$a + 1] = $position[1];$found[$a + 2] = "|";$a = $a + 3;$position[1] = "";
}
}
$CurUrl++;} reset($file);
}
}
}
I hope some one know how to speed this up.