Could you include a little of the surrounding code, doesn't seem to work when slotted into my bad code.
-------Here my current code---------
<?
$edit_text="";
$fp = fopen ("WACKADAY.txt","r");
$foundit = false;
while ($data = fgets ($fp, 100)) {
// once format is found, add lines to array
if ($foundit =="true") {
$edit_text[1] = $data;
}
// closing tag, so out of here
if(strstr($data,"P")) {
break;
}
// opening tag, so set switch
IF (eregi ("Q[0-9]{6}", $data, $regs)) {
$foundit = true;
}
}
fclose ($fp);
//Not the format I'm going to use but it'll do for testing.
echo "<TEXTAREA>$edit_text</TEXTAREA>";
//Just a dump of the $data var to see what actually did go in it
echo $data;
?>
I should point out that this is taken from an example of using eregi that someone else posted and I am modifying for my own purposes.
Here the file it's searching through:
+++++++++++++++++++++++++++++++++++++
WACKADAY (212.25.225.42)
* WINDOWS 2000 SP2
Patch NOT Found MS02-012 Q313450
Patch NOT Found MS02-013 Q300845
* INTERNET INFORMATION SERVICES 5.0
Patch NOT Found MS02-012 Q313450
* INTERNET EXPLORER 5.5 SP2
Information
All necessary hotfixes have been applied.
+++++++++++++++++++++++++++++++++++++
When the script find a Q number I want to copy that Q999999 into a variable/array.
So $Q1=Q313450
and so on.