Hi
thanks for your reply
I've tried to add preg_match_all into my code, but the array that it puts the results into only contains 1, when I use the count() function. When I print it to the screen, it contains all the text which is it meant to be parsing! I've tried with a simple regex, but the same thing happens.
I also tried that line of code which you wrote in your response, but didn't get me anywhere!!! :-(
I've only had limited experience working with preg_match before, so I maybe missing something really obvious. My whole code is:
$PagePath = "index.php";
$OpenPage = @fopen($PagePath, "r");
$ContentsBuffer = fread($OpenPage, filesize($PagePath));
if ($EntriesExtract == 0) {
$aExistingWorklogData[0] = "Error.";
} else {
$WorklogEntryTitleExtract = preg_match_all("/<div class=\"wt\">.*<\/div wt>/s", $aExistingWorklogData[0], $aExistingTitle);
print count($aExistingTitle);
// where the loop would go!
//if ($WorklogEntryTitleExtract !== 0) {
//$aNewTitle[0] = $aExistingTitle[0]."\n----------------------------------------";
//}//end if
//$aExistingWorklogData[0] = preg_replace("/<div class=\"wt\">.*<\/div wt>/s", $aNewTitle[0], $aExistingWorklogData[0]);
} //end if
fclose($OpenPage);
print "<pre>".$aExistingWorklogData[0]."</pre>";
exit;
It's not particularly long, but there must be a reason why preg_match_all isn't working as it should. I've also had a look at the manual and can't see anything I'm missing from there!
So fruststrating! grateful for any help!